Retrieve last child index in a Tile, child indices are zero-based : Tile « Container « Flex






Retrieve last child index in a Tile, child indices are zero-based

Retrieve last child index in a Tile, child indices are zero-based
         


<?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>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Create horizontal Tile containerCreate horizontal Tile container
2.Use Tile control's tileWidth to specify the width of the tilesUse Tile control's tileWidth to specify the width of the tiles
3.Get reference to last child in a TileGet reference to last child in a Tile
4.Remove item from TileRemove item from Tile
5.Tile DemoTile Demo
6.A Tile Container with draggable childrenA Tile Container with draggable children
7.Override layout to use TileLayoutOverride layout to use TileLayout
8.Create the horizontal Tile containerCreate the horizontal Tile container
9.Using Tile control's tileWidth property to specify the width of the tilesUsing Tile control's tileWidth property to specify the width of the tiles