Sunday, June 3, 2012

[Action Script] Rotating a wheel June,2012

Hi,

I am trying to rotate the wheel when I click the start button for some random amount of time. I am able to rotate the wheel when I click the button, but it is not stopping after the given amount of time.. Please help


var myClock:Timer = new Timer(10000, 0);
var time:Number =0;

start_button.addEventListener(MouseEvent.CLICK, rotateButtonClicked);
function rotateButtonClicked(evt:MouseEvent):void
{
wok.addEventListener(Event.ENTER_FRAME, startRotate);
}
function startRotate(evt:Event):void {
rotateCircle();
}
function rotateCircle():void
{
myClock.start();
wok.rotation += 15;
}
Rotating a wheel

Related Post



0 comments: