Jump to content
Search Community

Change TweenMax ticker speed?

BladePoint test
Moderator Tag

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

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.
×
×
  • Create New...