Jump to content
Search Community

repeating a tween rotation again, and again...

b18269 test
Moderator Tag

Recommended Posts

I have a rotating twitter feed that i want to rotate 10degrees every 2 seconds. It worked fine with the built in ease but Im new to greenshock and having trouble trying to figure out how to do this :(

 

The code below is what I have so far, all it does is tween to 1 position just once, thats it. But it is repeating every 2 seconds as I did a trace test.

 

repeatAgain()
function repeatAgain():void{
TweenMax.to(mytwitterfeed1, 1, {rotation:-10, ease:Bounce.easeOut, delay:2, onComplete:repeatAgain })
}

 

Can any of you more experienced guys shed some advice? Im not sure what I should be searching for, for help.....consecutive tweens, repeative tweens, realativre position tween from??

 

Thanks for help in advance,

 

B

Link to comment
Share on other sites

yeah, you need to use a relative value.

 

after the tween runs once, it is already at the absolute value of -10. so subsequent tweens don't have a new position to go to.

 

just use a String value "in quotes" as your destination value and you will be fine:

 

repeatAgain()

function repeatAgain():void{

TweenMax.to(mytwitterfeed1, 1, {rotation:"-10", ease:Bounce.easeOut, delay:2, onComplete:repeatAgain })

}

 

by using a relative value each time the tween runs it will rotate to a position -10 degrees away from the objects current rotation

Link to comment
Share on other sites

no problem. have fun with the GreenSock Tweening Platform it has a ton of features that make tasks like this super easy.

 

be sure to check out

 

Getting Started: http://www.greensock.com/get-started-tweening/

 

Tweening Tips and Tricks: http://www.greensock.com/tweening-tips/

 

Learning Resources: http://www.greensock.com/learning/

 

you will be a tweening master in no time!

 

Carl

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