How would I get to play backwards a timeline from a specific frame to another frame?
I need to be able to play back from frame 62 to 1 and from 101 to 62 depending on what frame I am on. I know I can do 2 if loops with if (currentFrame == 62)
etc but what is the code to play the timeline in reverse for AS3?
您可以使用Greensock的TweenLite类沿任一方向补间时间轴的帧。
Tweenlite.to ( mc, 1, {frame:1} );
Something like this:
stop();
var targetFrame:int = 62;
// if we are ahead of the target, start going backwards
if(currentFrame > targetFrame) stage.addEventListener(Event.ENTER_FRAME,goBack);
function goBack(evt:Event):void
{
prevFrame();
// kill the event listener when the target is reached
if(currentFrame <= targetFrame) stage.removeEventListener(Event.ENTER_FRAME,goBack);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.