2 Replies Latest reply on Jan 13, 2011 2:49 PM by Luis Pedro Ferreira

    TileList itemRender reorder

    Luis Pedro Ferreira

      Hi all.

      Hope you can help me on this, I'm sure lots of you already did what I'm trying to aim.

      Let's imagine a tileList like this:

       

      [ 0 ][ 1 ][ 2 ]

      [ 3 ][ 4 ][ 5 ]

      [ 6 ][ 7 ][ 8 ]

       

      Then I remove from the array the index 4. What I want to happen is when I remove the itemRender index 4, all the other itemRenders move left or right, up or down till they became in their new places. (hope you understand)

       

      I can't find any help or information about how to do this on internet, so if you know how to do it, please give me some clues.

      I read somewhere that there's a trick with 2 arrays but how does it wokrs??

       

      Hope one of you can help me with this.

       

      Thank you.

      Luis Pedro Ferreira

        • 1. Re: TileList itemRender reorder
          Gregory Lafrance Level 6

          This code answers your question:

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application
            xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:Script>
              <![CDATA[
                import mx.collections.ArrayCollection;
                
                [Bindable] private var ac:ArrayCollection = 
                  new ArrayCollection(["0", "1", "2", "3", "4", "5", "6", "7", "8"]);
              ]]> 
            </mx:Script>
            <mx:TileList dataProvider="{ac}" columnCount="3" 
              rowCount="3" width="100" height="100"/>
            <mx:Button label="Remove 4" click="ac.removeItemAt(4);"/>
          </mx:Application>
          

           

          If this post answers your question or helps, please mark it as such. Thanks!

          http://www.stardustsystems.com
          Adobe Flex Development and Support Services

          • 2. Re: TileList itemRender reorder
            Luis Pedro Ferreira Level 1

            Hi Gregory and thank you for your answer.

            Actualy it doesn't do what i'm trying to get. I know how to remove and add more itens either to an array, arrayCollection or even to a container.

            What I'm trying to get is an animation of the remaining indexes in the container when I add or remove an element.

             

            I read something about the event "itemschangeeffect" for the TileList on the mx components but does it realy works? cause I also read that Adobe remove that event from the component....

             

            LP