Jump to content
Search Community

Change Property at Runtime in TweenMax

Varun test
Moderator Tag

Recommended Posts

Hi,
 
   I have an animation, which run for infinity time, until server response.
 
I have created infinity response by repeat :-1 in TweenMax.
 
My Code is below
 

var tween:TweenMax;
tween = TweenMax.to(reel.getChildAt(i), speed, {ease:Linear.easeNone, repeat:-1, onUpdate:updateSymbolPosition, onUpdateParams:[reel, reel.getChildAt(i) as MovieClip, tween]});

Now I want to update the reel symbol y position on Update function. so what should i do for this?

 

private function updateSymbolPosition(reel:MovieClip, currentElement:MovieClip, tween:TweenMax):void
{
     //What should i write here to update the currentElement y position?
     //i can add currentElement.y to update this. But i need new target position to update in TweenMax object, for a better smooth animation.
}

 

Link to comment
Share on other sites

I'm not sure I understand your goal here. Perhaps you're just looking for the TweenMax.updateTo() method? But in most cases, it's just better to create a new tween instead of constantly trying to update an existing one. It'd probably actually be a bit faster too. 

  • Like 1
Link to comment
Share on other sites

Basically I am doing reel Spinning. So i found BlitMask a better option now. But i have one query in this. Can i update the Reel Symbols at run time, while reel spinning? i tried to remove a movieclip child but its not updating in the reel. i tried bm.update() also for this. But no effect. So can you help me in this?

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