Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

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...

Please update flash player to view this Flash ActionScript tutorial!

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{

output_txt.text = "Mouse is in moving status";


stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoving);


// Check mouse click down
function mousePressDown(evt:MouseEvent):void{

output_txt.text = "Mouse is in pressed down status";


stage.addEventListener(MouseEvent.MOUSE_DOWN, mousePressDown);


// Check mouse release up after click down
function mouseReleaseUp(evt:MouseEvent):void{

output_txt.text = "Mouse is released up now";


stage.addEventListener(MouseEvent.MOUSE_UP, mouseReleaseUp);


// Check if mouse is over the Enter Button
function mouseOverBlueButton(evt:MouseEvent):void{

output2_txt.text = "...and Mouse is also over Button now";


blue_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverBlueButton);


// Check if mouse leave the Enter Button
function mouseOutBlueButton(evt:MouseEvent):void{

output2_txt.text = "";


blue_btn.addEventListener(MouseEvent.MOUSE_OUT, mouseOutBlueButton);

Download Flash Source File:

Flash Source File mouse-2.fla


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.