Hi, I’m noob with Flash and I would like some help
So, I have 2 gears that need to be rotating each other, I tried to do it by means of AS1, but it didn’t work, don’t lnow why exactly but one gear some times ended its rotation after the other have stopped, so I decided to do it in AS3 with it’s FrameRate control and I came up with this code
stage.frameRate = 0;
addEventListener(MouseEvent.MOUSE_OVER, activate);
function activate(event:MouseEvent)
{
addEventListener(Event.ENTER_FRAME, increaseSpeed);
removeEventListener(Event.ENTER_FRAME, decreaseSpeed);
}
function increaseSpeed():void
{
if(stage.frameRate < 65)
stage.frameRate ++;
else
stage.frameRate = 65;
}
function decreaseSpeed():void
{
if(stage.frameRate > 0)
stage.frameRate --;
else
stage.frameRate = 0;
}
The FrameRate won’t go up =)