Jump to content
Search Community

short rotation

chefkeifer test
Moderator Tag

Recommended Posts

i have another issue..got the yoyo thing to work but for some reason i cannot get the short rotation to go another 180..any thoughts..

 

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

var guestFlip:TimelineMax = new TimelineMax({repeat:5, yoyo:true, repeatDelay:1});
			guestFlip.append(TweenMax.to(btn1, 1, {shortRotation:{rotationY:"180"}}));
			guestFlip.insert(TweenMax.to(btn1.woods,   1, {alpha:0}));
			guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:1}));
			guestFlip.append(TweenMax.to(btn1, 1, {shortRotation:{rotationY:"180"}}));
			guestFlip.insert(TweenMax.to(btn1.tractor, 1, {alpha:0}));
			guestFlip.insert(TweenMax.to(btn1.tuttle, 1,  {alpha:1}));

Link to comment
Share on other sites

tweens values are not cumulative, so if you yoyo a timeline/tween, it doesn't go 0 > 180 > 0 > 360 > 0 > 540. If it did, a lot of users would be really frustrated :) If you want that behavior, you need to set up a sequence of tweens/timelines that go to those values. Also, you can invalidate() a tween or timeline to clear out all the starting values that it recorded when the tweens began.

Link to comment
Share on other sites

Sorry, I confused this post with another one. The problem likely has to do with the fact that you're using shortRotation and adding exactly 180 degrees. Why not just do a regular rotation:"180"? shortRotation always tries to figure out the shortest direction to go which may not be what you're looking for in this scenario.

Link to comment
Share on other sites

with doing that is seems to just skip right over that second rotation

 

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

var guestFlip:TimelineMax = new TimelineMax({repeat:5, yoyo:true, repeatDelay:3});
			guestFlip.append(TweenMax.to(btn1, 1, {rotationY:180}));
			guestFlip.append(TweenMax.to(btn1.woods,   1, {alpha:0}));
			guestFlip.append(TweenMax.to(btn1.tractor, 1, {alpha:1}));
			guestFlip.append(TweenMax.to(btn1, 1, {rotationY:180}));
			guestFlip.append(TweenMax.to(btn1.tractor, 1, {alpha:0}));
			guestFlip.append(TweenMax.to(btn1.tuttle, 1,  {alpha:1}));

Link to comment
Share on other sites

i got it to work a bit better. I am having issue with the insert with the last two tweens. It needs to happen the same time the rotation to "0" how do i delay three different tweens at the same time.

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

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

Link to comment
Share on other sites

First of all, the reason it appeared as though it was skipping the 2nd rotation is because both tweens were going to a value of 180. So after the first one finished, it was at 180, then the 2nd one started and tweened from 180 to 180 (no change).

 

As for controlling where tweens are placed on the timeline, you have complete control using insert() or insertMultiple(). You can even appendMultiple() and they'll all get appended at the same spot unless you define a different alignment or stagger in the method call. Check out the docs at

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