2 Replies Latest reply on May 3, 2010 10:25 AM by dmodie

    trouble with parallel add and remove effect in TileList

    dmodie Level 1

      We have a TileList of images.  As the user drags a new image along the list (deciding where to drop it) a blank frame drops in to show them where it will be inserted when they drop it.  Therefore, I have to add and remove simultaneously, while still dragging.  For example if they are at index zero, a blank frame is in index zero.  As they move to 1, the blank frame appears to move from index zero, to index one, as the image that was at index one appears to move to index zero.  But what I'm really doing is just removing and then adding the blank frame.

       

      I think the following code should accomplish this.  And it works, most of the time.  Every so often, there is a delay where is does the REMOVE, and then waits until the Back.easeOut tween is complete, and then does the ADD.   It is intermittent.  Any ideas, or is there a better way to do it?  Thanks

       

      MXML code:


          <mx:Sequence id="myEffect">
              <mx:Parallel>
                  <mx:Move
                      duration="600"
                      easingFunction="{Back.easeOut}"
                      />
                  <mx:RemoveItemAction id="dcmRemoveItemActionTag"
                                      
                                       />
                  <mx:AddItemAction  id="dcmAddItemActionTag"
                                     />
              </mx:Parallel>
          </mx:Sequence>

       

       

      actionscript code:

       

       

                      _sharedMedia.removeItemAt(_sharedMedia.getItemIndex(_dropPlaceHolderimage));
                      _sharedMedia.addItemAt(_dropPlaceHolderimage,dropIndex);