flex accessing children of a list component

Posted by pfunc on Stack Overflow See other posts from Stack Overflow or by pfunc
Published on 2010-04-15T19:20:13Z Indexed on 2010/04/15 19:23 UTC
Read the original article Hit count: 138

Filed under:

when I try to loop through the children of a List component that has buttons in it, I can't seem to access those children.

I try

for(var btnNum:Number = 0; btnNum < myList.numChildren; btnNum++)
{

  trace(myList.getChildAt(btnNum);

}

but it is giving some other instance, not the button instances.

and the weeklist

<mx:List id="myList"  dataProvider="{_data.mappoints.week.@number}"  >
                <mx:itemRenderer  >
                    <mx:Component>


                        <mx:Button buttonMode="true" toggle="true"  alpha="1" width="116" height="35" label="WEEK {data}" >

                        </mx:Button>

                    </mx:Component>
                </mx:itemRenderer>
            </mx:List>

© Stack Overflow or respective owner

Related posts about flex