I'm trying to create a function (called by a mouseover event) which will play the movie backwards while the mouse is over the instance, and stop while it's not.
This is what I have so far:
var b2:rightButton = new rightButton(); //new instance
b2.X = 550; //instances position
addChild(b2); //add instance to stage
b2.alpha = .4; // set instances alpha
var num = 0; // new variable called 'num'
b2.addEventListener(MouseEvent.ROLL_OVER, rightScroll); //mouse event for roll over
function rightScroll(event:MouseEvent) { //the function
num = 1; //set num to 1
b2.alpha = .8; //set alpha to 80%
}
b2.addEventListener(MouseEvent.ROLL_OUT, no_rightScroll); //event for roll out
function no_rightScroll(event:MouseEvent){ //roll- out function
num = 0; //set num back to 0
b2.alpha = .4; //set alpha back to 40%
}
while (num == 1){ // while num =1 (while mouse is over)
prevFrame(); //goto previous frame
}
Does anyone knows how to fix that, or a better way to do this?