Hi people.
Im trying to write the codes for buttons that make a Square rotate faster and slower. I tried hard but it did not work. Any help, appriciated, thanks.
how about a slider to control speed of the square_mc. can some1 give me the code. thanks
this is the code:
addEventListener(Event.ENTER_FRAME, startRotate);
function startRotate(evt:Event):void {
// Call function rotateSquare
rotateSquare();
}
function rotateSquare():void {
// Rotate the MovieClip
square_mc.rotation += 3;
output_txt.text = "Current rotation angle: " + square_mc.rotation;}
slower_btn.addEventListener(MouseEvent.MOUSE_DOWN, slower);
function slower(evt:MouseEvent):void {
square_mc.speed -=1;
}
faster_btn.addEventListener(MouseEvent.MOUSE_DOWN, faster);
function faster(evt:MouseEvent):void {
square_mc.speed +=1;
}