Skip to main content
May 14, 2010
Question

Animation stops working after swapping.

  • May 14, 2010
  • 1 reply
  • 714 views

I have a class which extends a SWC , in the swc i have two boxes, front and back and an animation on the same timeline. The animation works fine without swapping when I swap them the animation stops working. Anyway I can make it work?

I have the following code :

var frontTemp: DisplayObject = this.animationInstance.getChildByName("front");
var backTemp: DisplayObject = this.animationInstance.getChildByName("back");
this.animationInstance.swapChildren(frontTemp,back Temp);
this.animationInstance.gotoAndPlay("animation");

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 14, 2010

applying any display change (with actionscript) to a timeline tweened object always breaks the timeline tween.   

to resolve, use actionscript to change the display AND tween the object or use the timeline to do both.

May 14, 2010

Hello, this is what I'm trying to achieve: I've already made all the tweens in the swc but on some certain parts of the tween, I need to change the layer ordering (dynamically).

How do I work this one around?

kglad
Community Expert
Community Expert
May 14, 2010

change your swc so it tweens using actionscript.