Jump to content
Search Community

reverse [SOLVED]

chefkeifer test
Moderator Tag

Recommended Posts

I am having some issue getting my tween to reverse. any suggestions would be great. its just stays stationary and does not tween at all..

 

btn1.tractor.alpha = 0;
btn1.tractor.rotationY = 180;

var guestFlip:TimelineMax = new TimelineMax({reverse:true, repeatDelay:5});
			guestFlip.append(TweenMax.to(btn1, 3, {shortRotation:{rotationY:180}}));
			guestFlip.insert(TweenMax.to(btn1.woods, 1, {alpha:0}));
			guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:1, delay:1}));
			guestFlip.reversed = true;

Link to comment
Share on other sites

Please read the notes in the documentation about the "reversed" special property (http://www.greensock.com/as/docs/tween/). Remember, it makes the tween/timeline go back towards the beginning, so if you create a tween/timeline and immediately reverse it, since it is already at the beginning, it will appear to do nothing. You can set the totalProgress to 1 to force it to the end so that you see it go backwards all the way from the end to the beginning.

Link to comment
Share on other sites

Thanks, after I posted I came up with this. and it works but after it reverses and goes to the beginning and then stops. How do i just get it to loop back and forth.

btn1.tractor.alpha = 0;
btn1.tractor.rotationY = 180;

var guestFlip:TimelineMax = new TimelineMax({repeat:1, repeatDelay:5});
			guestFlip.append(TweenMax.to(btn1, 3, {shortRotation:{rotationY:180}}));
			guestFlip.insert(TweenMax.to(btn1.woods,   1, {alpha:0}));
			guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:1,onComplete:reverse}),guestFlip.duration - 0.5);


function reverse(){
guestFlip.reversed = true;
}

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