How do you call a movie clip to animate but only while the cursor is in the stage area?
Printable View
How do you call a movie clip to animate but only while the cursor is in the stage area?
I would use the rollover features of a button. You can make the an invisible button by only having a shape only on the hit area frame.
Or you could use the mouseX and mouseY properties. Set up a timer object to check the mouseX and mouseY every so often.
so how does the invisible button call the animation to work once it is hovered by the cursor?
Code:if(mouseX<stage.stageWidth && mouseX>0 && mouseY<stage.stageHeight && mouseY>0){
//execute desired code
}
and this code has to be on the main timeline rather than on the button in AS3?
yep, that will make sure that whatever your desired code is it only executes while the mouse is within the bounds of the stage. You'll probably want it to be in a function that handles an ENTER_FRAME event so that it checks for each frame. Savvy?