Hi,
I have a Adobe Flex project in which resides the following layout markup.
<s:TileGroup id="grid" width="467" height="467" requestedRowCount="15" requestedColumnCount="15" horizontalGap="0" verticalGap="0" verticalAlign="middle" name="tg">
<s:BorderContainer width="31" height="31" name="container">
<s:Label text="999" verticalAlign="middle" textAlign="center" paddingLeft="0" paddingRight="2" paddingBottom="0" paddingTop="0" width="29" height="29" click="Clicked(event)"/>
</s:BorderContainer>
<s:BorderContainer width="31" height="31" name="container">
<s:Label text="999" verticalAlign="middle" textAlign="center" paddingLeft="0" paddingRight="2" paddingBottom="0" paddingTop="0" width="29" height="29" click="Clicked(event)"/>
</s:BorderContainer>
...
...
</s:TileGroup>
I would like to be able to get the value of each of the text (as int) attribute in the s:Label element. I tried this:
var count:int = 0;
for each (var b:BorderContainer in grid)
{
count += parseInt((b.getElementAt(0) as Label).text);
}
But that does not work. In fact, when debugging "b" is always null even though "grid.getElementAt(0)" returns a BorderContainer.
I would appreciate any help anyone can provide me in solving my problem.
Thanks,
Kamal.