14 Replies Latest reply on Aug 22, 2011 5:45 PM by wanderingWriter

    Effect on Sprite breaks drag&drop mechanics




      I've a problem with applying effects to a number of SpriteVisualElements.


      I had set up a grid of said sprites and could drag and drop them around using the startDrag() and stopDrag() methods.

      I then decided to use effects to somehow animate these sprites when I click or drag them, and chose to play the effects in the handler of the MouseEvent.MOUSE_UP event.


      Things still work, but.... some effects break the drag&drop operation.

      The first time I drag or click the sprites everything works fine, but when I try to drag them again after the effect has been played once they won't drop. I can see the sprites move along with the mouse cursor as i drag them, but when I release the mouse button the sprites jump back to their starting position instead of dropping where I've just dragged them.


      This happens only on individual sprites once the effect has been played on them a first time. After that the effect still plays each time (meaning that the MOUSE_UP event is dispatched), but they won't drop.


      I'm also tracking the coordinates of the sprites as they are dragged, using a label I update through the MOUSE_MOVE event. The sprites' coordinates update normally the first time I drag&drop them, but then, after the effect is played for the first time, the coordinates won't update either.


      This only happens with effects that affect the sprites' appearance: s:Animate (scaleX, scaleY), s:Rotate, s:Scale.


      The only one that seems to work without causing any problem is s:Move. Don't understand why.


      Does anyone have any idea?

      Thanks a lot