• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

TileList itemRender reorder

New Here ,
Jan 12, 2011 Jan 12, 2011

Copy link to clipboard

Copied

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

Views

582

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 13, 2011 Jan 13, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 13, 2011 Jan 13, 2011

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines