Jump to content
GreenSock

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

Change TweenMax ticker speed?

Recommended Posts

I am tweening a large, background object containing a high number of transparencies, and it seems to be causing a bit of a performance hit. I am just tweening its scaleX property from 1 to 1.015 and back on a yoyo loop over several seconds, so its a very subtle effect. My Flash is running at 60 fps, but this particular object probably doesn't need to be updated by TweenMax that often since the visual effect is so subtle. Is there a way to change the TweenMax's ticker speed just for this tween, so I can reduce the number of redraws and improve performance?

Link to comment
Share on other sites

The JavaScript version has that capability, but not Flash. You could, however, write extra code so that you're leveraging onUpdate calls that use your own logic to skip making changes every X number of ticks or something, but that's a bit clunky. I wish I had a simple answer for you. 

Link to comment
Share on other sites

Thanks, that idea worked.

var tweenPoint:Point = new Point(1,0); // (scaleX,tick counter)
TweenMax.to(tweenPoint,4,{x:1.015,onUpdate:updateFunction});

function updateFunction():void {
  tweenPoint.y += 1;
  if (tweenPoint.y % 2 == 0) myObject.scaleX = tweenPoint.x;
}
Out of curiosity, is there another way to make TweenMax directly skip an update during onUpdate?
Link to comment
Share on other sites

I'm not sure I understand your question. Could you elaborate? Are you asking what logic you could put into your onUpdate function to skip every X ticks? 

Link to comment
Share on other sites

I was just wondering if there was a TweenMax method that you could call during onUpdate that would tell it not to update for that tick. I didn't see anything in the docs, so I guess not. It's fine though, what I did seems to work well enough.

Link to comment
Share on other sites

Nope, sorry, there isn't such a method. Glad you got it working in a way that will suffice. 

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.
×