Mega Code Archive

 
Categories / Flex / Container
 

Get reference to last child in a Tile

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Script>                  private function moveToTheBeginning(  ):void         {             var lastChildIndex:int = tileOfLabels.numChildren;             var child:DisplayObject = tileOfLabels.getChildAt(lastChildIndex);             tileOfLabels.setChildIndex(child,0);         }            </mx:Script>     <mx:Tile id="tileOfLabels">         <mx:Label text="1"/>         <mx:Label text="2"/>         <mx:Label text="3"/>         <mx:Label text="4"/>         <mx:Label text="5"/>         <mx:Label text="6"/>     </mx:Tile>     <mx:Button label="Move" click="moveToTheBeginning(  )"/> </mx:Application>