I have a component being called within a repeater. Within the call, i'm passing several variables to the component. All of them work fine except for one named totalSpan... which is returning a NaN for some reason. Here's the code I'm working with:
Parent:
<mx:Repeater id="indPositions" dataProvider="{projectPositions}" startingIndex="0" count="{projectPositions.length}">
<components:block height="28"
id="thisBlock" visible="true" horizontalScrollPolicy="off"
width="{projectWidth}"
oneDay="{Number(oneDay)}"
offSet="{indPositions.currentItem[0]}"
numDays="{indPositions.currentItem[1]}"
position="{indPositions.currentItem[2]}"
sName="{indPositions.currentItem[3]}"
projectName="{projectTitle}"
totalSpan="{Number(Math.round(projectWidth.vl / oneDay))}"
/>
</mx:Repeater>
All of the variables in there work fine and will typeof() just fine.
Here's the child code:
[Bindable] public var totalSpan:Number;
and then in the init() function I perform a simple:
Alert.show(String(totalSpan));
The alert returns "NaN".
On a semi-related note, i'm getting warnings on the following lines of the parent:
offSet="{indPositions.currentItem[0]}"
numDays="{indPositions.currentItem[1]}"
position="{indPositions.currentItem[2]}"
sName="{indPositions.currentItem[3]}"
with an message that says "Data binding will not be able to detect chances when using square bracket operator. For Array, please use ArrayCollection.getItemAt() instead.
Can anybody shed some light on these warning errors? an example would be greatly appreciated.