Remove item from Tile : Tile « Container « Flex






Remove item from Tile

Remove item from Tile
         
<?xml version="1.0"?>
<mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
        
            import mx.effects.DefaultListEffect;
            import mx.collections.ArrayCollection;
            
            [Bindable]
            private var dataCollection:ArrayCollection = new ArrayCollection();
            
            private function removeFromList():void {
                var index : int = dataCollection.getItemIndex( tileList.selectedItem );
                dataCollection.removeItemAt( index );
            }

            private function addToList():void {
                dataCollection.addItemAt( Math.random(), 0);
            }            
      
    </mx:Script>

    <mx:DefaultTileListEffect id="effect" moveDuration="250" fadeInDuration="250" fadeOutDuration="250" />

    <mx:TileList id="tileList" width="500" height="200" dataProvider="{ dataCollection }" itemsChangeEffect="{ effect }" />

    <mx:HBox>
        <mx:Button label="Add New Item" click="addToList();" />
        <mx:Button label="Remove Selected Item" click="removeFromList();" />
    </mx:HBox>
    
</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.Retrieve last child index in a Tile, child indices are zero-basedRetrieve last child index in a Tile, child indices are zero-based
4.Get reference to last child in a TileGet reference to last child in a 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