I need to create an array dynamically at runtime based on an unknown number of MXML objects. In this particular example, I have an unknown number of ToggleButton objects. I wanted to just put them in the array using push, in a structure like this:
Sorry, for some reason it just posted before I was done. Anyway, it tells me that I can't use it, becuase of "Access of undefined property btnX". How can I better do this?
this code will fill an array with all toggle buttons in a particular container (in this example, a group with id of "myGroup"):
var len:uint = myGroup.numElements;
var btns:Array = ;
for (var i:uint=0;i<len;i++)
if (myGroup.getElementAt(i) is ToggleButton)