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

reversing animation with actionscript 3

Explorer ,
Jul 17, 2013 Jul 17, 2013

Copy link to clipboard

Copied

I'm making a website with basic timeline navigation.  Which is typically how I prefer to work because I'm from an animation background and more visually oriented then code oriented.  I'm wondering if it's possible to play in reverse along the timeline so that if animation plays when you navigate to one section it will then play in reverse when I click the back button.  Is this at all possible...or a simple method that would achieve the same effect?

TOPICS
ActionScript

Views

2.3K

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
Community Expert ,
Jul 17, 2013 Jul 17, 2013

Copy link to clipboard

Copied

LATEST

you can call mcF to play any timeline from any frame to any other frame by passing the movieclip, start frame and end frame.

for example, to play the root timeline from frame 33 to frame 1 (ie, in reverse), use:

mcF(MovieClip(root),33,1);

// change nothing below

function mcF(mc:MovieClip,startFrame:int,endFrame:int):void{

mc.startFrame = startFrame;

mc.endFrame = endFrame;

mc.addEventListener(Event.ENTER_FRAME,playF);

}

function playF(e:Event):void{

var mc:MovieClip = MovieClip(e.currentTarget);

if(mc.startFrame<mc.endFrame){

mc.nextFrame();

} else if(mc.startFrame>mc.endFrame){

mc.prevFrame();

}

if(mc.currentFrame==mc.endFrame){

mc.removeEventListener(Event.ENTER_FRAME,playF);

}

}

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