var dial:Sprite;
var radius:Number = 0;
var angle:Number = 0;
var angleConvert:Number = 180 / Math.PI;
init();
function init():void
{
makeDial();
makeOrb();
}
function onMove(e:MouseEvent):void
{
angle = Math.atan2(mouseY - dial.y, mouseX - dial.x);
volumeMC.rotation = angleConvert * angle + 90;
}
function onOrbDown(e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
stage.addEventListener(MouseEvent.MOUSE_UP, onOrbUp);
}
function onOrbUp(e:MouseEvent):void
{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, onOrbUp);
}
function makeDial():void {
dial = new Sprite();
var g:Graphics = dial.graphics;
g.lineStyle(2, 0x333333);
g.drawCircle(0, 0, radius);
dial.x = 170;
dial.y = 370;
addChild(dial);
}
function makeOrb():void {
volumeMC.buttonMode = volumeMC.useHandCursor = true;
volumeMC.addEventListener(MouseEvent.MOUSE_DOWN, onOrbDown);
}
Hi
I have a volumeMC dial that drags and drops great, but I want to use the rotation snap in tweenMax to make this better.
All I want it to do is ....
1] drag rotate volumeMC around its own centre from 0-360deg in 10deg intervals.
2] to trace the current rotation value to I can adjust the sound.
here is what I have that works but I don't like it ...
hope someone can help
Steven