Hippiesvin Posted February 8, 2013 Share Posted February 8, 2013 Hi Greensock 1. Why is 2 movieclips both rotated from -90 to 190 going cw using TweenMax.to and ccw using TweenMax.from? 2. Is there a way to make .from go CW in this example? note: both going cw when var rotateTo <=180 in example below //HippieSvin import com.greensock.easing.*; import com.greensock.plugins.*; import com.greensock.TweenMax; var rotateTo:Number = 190; var rotateFrom:Number = -90; // CCW // RED : TM animating FROM -90 to 190 var c1:MovieClip = new MovieClip(); this.addChild(c1); c1.x = 275; c1.y = 200; c1.rotation=rotateTo; var red:MovieClip = new boxRed(); c1.addChild(red); red.x=-50; TweenMax.from(c1, 3, { delay:1.0, rotation:rotateFrom, ease:Quad.easeInOut }); // CW // GREEN : TM animating TO 190 from -90 : this goes CW var c2:MovieClip = new MovieClip(); this.addChild(c2); c2.x = 275; c2.y = 200; c2.rotation=rotateFrom; var green:MovieClip = new boxGreen(); c2.addChild(green); green.x=-50; TweenMax.to(c2, 3, { delay:1.0, rotation:rotateTo, ease:Quad.easeInOut }); Link to comment Share on other sites More sharing options...
GreenSock Posted February 10, 2013 Share Posted February 10, 2013 If you want it to go in the shortest direction, use the shortRotation plugin. If you want it to go in a particular direction, you can use relative values. You'd need to do the math up front to figure out now many degrees you need it to go in the particular direction and then feed it in as a relative value. For example, if you want to go clockwise, make sure the value is increasing. To go 110 degrees clockwise, you'd do var dif:Number = 110; TweenMax.to(mc, 3, {rotation:"+=" + dif}); And to go counter-clockwise, use a negative value, prefixing it with "-=". Link to comment Share on other sites More sharing options...
RonK Posted October 6, 2016 Share Posted October 6, 2016 This works for me in Firefox, but in Chrome the rotated element starts walking away after every rotation. Link to comment Share on other sites More sharing options...
Carl Posted October 6, 2016 Share Posted October 6, 2016 Hi RonK, I'm a little confused. We have never had an issue with Flash Player handling basic code like this differently depending on browser. Is it possible this is an HTML5 / JS issue? I'm guessing that you posted in our Flash Archive accidentally. If so, can you please post a new topic in our HTML5 forums with a very simple CodePen demo so that we can easily test your code in different browsers and quickly offer a solution. If this is truly a Flash / ActionScript problem, please provide a very basic FLA that we can look at. Zip it and attach it to this post using the "more reply options" button. Thanks! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now