Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
cristina

timeline plays slowly on reverse

Recommended Posts

Hello,

 

I'm currently working on an application with various menus which have an opening animation. I've created a timeline for each menu. To open the menu, I play() the timeline. To close the menu, I reverse() it. This worked on multiple cases, but I've been stuck with a menu which plays much slowly on reverse, even though I have stated "useFrames:true" and "ease:Linear.easeNone". I'll paste the code bellow:

 

var endframe : int = mc.totalFrames-1;

var duration : int = mc.totalFrames-1;

var tween : TweenMax = new TweenMax(mc, duration, {useFrames:true, frame:endframe, ease:Linear.easeNone});

var timeline : TimelineMax = new TimelineMax({paused:true, useFrames:true});

timeline.insert(tween);

 

function OpenMenu(evt:MouseEvent)

{

timeline.play();

}

 

function CloseMenu(evt:MouseEvent)

{

timeline.reverse();

}

 

RESULT: the menu closes in slow motion, as if something was wrong, delaying the whole process. However, I've accomplished this successfully before. What am I missing here..?

 

Thank you in advance..!

Link to comment
Share on other sites

The only thing I can think of is that you've got other stuff going on in your app that's causing the frame rate to drop during that animation. Since you told the tween to useFrames, it will force it to use that exact number of frames to render, so if the frame rate drops then your tweens will go slower. Have you checked the frame rate during the animation? Keep in mind that most of the time, graphics rendering is by FAR the biggest CPU drain (not ActionScript execution or the tweening engine which is just ActionScript anyway). So if you've got some big object animating or complex vectors or text (which is vectors) or masked stuff, it can really slow Flash down in terms of graphics rendering.

 

If you're still stuck, feel free to post a sample FLA that clearly demonstrates the problem (the simpler the better - no need to post production files).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×