Search code examples
actionscript-3flashtimeline

AS3: restoring timeline animation after code alteration


I have a movie clip that I animate in my timeline. At a certain point of my code I need to move that mc by actionscript and at another point I need it to do the timeline animation.

Now, I know that if I alter my movieclip through AS the timeline animations will be ignored further on, but I was wondering: is there a way to force the movieclip to follow the timeline tweenings back again?


Solution

  • No. Once you change a property, it is detached from the timeline.

    One solution is having another movieclip inside that movieclip. That way, the timeline animates the main movieclip, but you can access the inner movieclip with a reference to it and do whatever additional transformations you want to it. How you do this will depend on what exactly you're doing, and you have to remember the transformations will "stack", but it works.