Monitor Mouse Pointer Status with Flash ActionScript 3
This Flash ActionScript tutorial shows how to track the status of mouse pointer, for example, when the mouse pointer is over an object, when the mouse pointer leaves an object, etc...Flash Tutorial Content:
Sometimes it also requires to know when the Mouse Pointer is over an object and when it leaves the object. The Flash ActionScript tutorial shows how to do it.
The complete Flash Movie is shown as above, you may try how it works before you start this tutorial.
Flash ActionScript Codes:
// Track mouse moving
function mouseMoving(evt:MouseEvent):void{
}
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoving);
// Check mouse click down
function mousePressDown(evt:MouseEvent):void{
}
stage.addEventListener(MouseEvent.MOUSE_DOWN, mousePressDown);
// Check mouse release up after click down
function mouseReleaseUp(evt:MouseEvent):void{
}
stage.addEventListener(MouseEvent.MOUSE_UP, mouseReleaseUp);
// Check if mouse is over the Enter Button
function mouseOverBlueButton(evt:MouseEvent):void{
}
blue_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverBlueButton);
// Check if mouse leave the Enter Button
function mouseOutBlueButton(evt:MouseEvent):void{
}
blue_btn.addEventListener(MouseEvent.MOUSE_OUT, mouseOutBlueButton);
Download Flash Source File:
Remarks:
Many Flash Movies will use an interesting custom Mouse Pointer. This is very easy to do with Flash ActionScript 3. The next ActionScript tutorial will show you how to do it.