Tile List Custom Effect and Default Effect : TileList « Container « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Container » TileListScreenshots 
Tile List Custom Effect and Default Effect
Tile List Custom Effect and Default Effect
   

<!--
Code from Flex Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1proper attribution to Adobe is given as the owner of the user guide; and 
  (2any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



    <!-- dataEffects\TileListEffectCustomDefaultEffect.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"
    height="500">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
    <fx:Script> 
         
        import mx.effects.DefaultTileListEffect; 
        import mx.effects.easing.Elastic; 
        import mx.collections.ArrayCollection; 
        import mx.effects.Move; 
        [Bindable
        private var myDP:ArrayCollection = new ArrayCollection(["A","B",'C','D','E','F','G','H','I','J','K','L','M','N','O','P'])
        private function deleteItems():void 
            // As each item is removed, the index of the other items changes. 
            // So first get the items to delete, and then determine their indices 
            // as you remove them. 
            var toRemove:Array = []
            for (var i:int 0; i < tlist0.selectedItems.length; i++
                toRemove.push(tlist0.selectedItems[i])
            for (i = 0; i < toRemove.length; i++
                myDP.removeItemAt(myDP.getItemIndex(toRemove[i]))
        
        private var zcount:int 0
        private function addItems():void 
            myDP.addItemAt("Z"+zcount++,Math.min(2,myDP.length))
        
      
    </fx:Script>
    <fx:Declarations>
        <!--
            Define an instance of the DefaultTileListEffect effect, and set its
            moveDuration and color properties.
        -->
        <mx:DefaultTileListEffect id="myDTLE"
            moveDuration="100" />
    </fx:Declarations>
    <mx:TileList id="tlist0" height="400" width="400"
        columnCount="4" rowCount="4" fontSize="30" fontWeight="bold"
        direction="horizontal" dataProvider="{myDP}" allowMultipleSelection="true"
        offscreenExtraRowsOrColumns="2" itemsChangeEffect="{myDTLE}" />
    <mx:Button label="Delete Selected Item(s)" click="deleteItems();" />
    <mx:Button label="Add Item" click="addItems();" />
</s:Application>

   
    
    
  
Related examples in the same category
1.Using a TileListUsing a TileList
2.Set data for a TileList controlSet data for a TileList control
3.TileList DataProviderTileList DataProvider
w___ww__.___j_a___va_2__s___._c___o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.