Hey guys,
In my project i have a mc called theArrow, which contains 85 frames of animation, and a roll-over region called mouseRegion.
When the mouse rolls over the region i want theArrow mc to play backwards from the point it is at, and when the mouse leaves the region i want it to resume playing forward again.
here is my script:
theArrow.addEventListener(event.ENTER_FRAME, playBck);
function playBck(event:Event):void {
this.theArrow.prevFrame();
}
mouseRegion.addEventListener(MouseEvent.ROLL_OVER, mouse_In, false, 0, true);
mouseRegion.addEventListener(MouseEvent.ROLL_OUT, mouse_Out, false, 0, true);
function mouse_In(event:MouseEvent):void {
if (this.theArrow.currentFrame==1) {
this.theArrow.stop();
} else {
this.theArrow.playBck();
}
}
function mouse_Out(event:MouseEvent):void {
if (this.theArrow.currentFrame==85) {
this.theArrow.stop();
} else {
this.theArrow.play();
}
}
Any Ideas?
Thanks in advance.