Jump to content
Search Community

Rotation of Wheel going Clockwise. Then goes CounterClockwise

sgershen test
Moderator Tag

Recommended Posts

I am hoping that someone can help me out with this problem I am having.  I have a bonus wheel spinning in a clockwise direction. each "pie" is a number.  I have degrees set to stop on a specific number everytime the flash refreshes. Whats happening is it goes in a clockwise rotation for the spin but when the number gets generated to stop at a number  it takes the shortest route to that number (degree) and then goes in reverse.  It doesnt happen all the time but sporadically.  i am trying to resolve this but cant seem to figure it out.  

 

My goal is to always rotate clockwise and stop at the number.  Attached to this post is the actionscript that shows you how i coded it.  IT doesnt work for me!  I hope someone can help me with this thanks in advancewheel.txt

Link to comment
Share on other sites

Sure, that's what our DirectionalRotation plugin is for:

 

import com.greensock.*;
import com.greensock.plugins.*;
TweenPlugin.activate([DirectionalRotationPlugin]);

//TweenMax.to(mc, 1, {directionalRotation:"90_cw"}); //clockwise
//TweenMax.to(mc, 1, {directionalRotation:"90_ccw"}); //counter-clockwise
//TweenMax.to(mc, 1, {directionalRotation:"90_short"}); // shortest distance


//or use a variable + suffix90 degrees clockwise
var degrees:Number = 90;
TweenMax.to(mc, 1, {directionalRotation:degrees + "_cw"}); 

http://api.greensock.com/as/com/greensock/plugins/DirectionalRotationPlugin.html

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