Tracking mouse leaving the Flash Player (AS3)

By | January 3, 2007

[kml_flashembed movie=”http://blog.metah.ch/image/example/mouseTrap.swf” height=”200″ width=”300″ /]

Actionscript 3.0 allow us to detect easily when the mouse leave the Flash Player, making it possible to avoid strange behavior of our clip. For example during “drag and drop” it can be useful to know when the mouse leave the stage. To do this you just have to use the Mouse Event : mouse_out 😉

stage.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
Were outHandler is the function called by the listener.

To have the movie work you will need the New Flash Player.
Ahmet

 
0 Kudos
Don't
move!

6 thoughts on “Tracking mouse leaving the Flash Player (AS3)

  1. Pingback: Metah Blog

  2. Pingback: myFeedz - Articles on "actionscript"

  3. Pingback: Home

  4. hai anh

    could you send to me a code of tracking mouse.
    i need it for my project
    thank you!

    Reply
  5. hai anh

    i want use it in MX 2004. but MX has not AS3. how do i do? and can you show me the use of mousetrap.as? i am a beginner

    Reply

Thoughts?