EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Mouse Class

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
476 Chapter 12: ActionScript Dictionary
In general, a user runs a JSAPI script by selecting Commands > Run Command. However, you
can use this function in an ActionScript script to call a JSAPI command directly. If you use
MMExecute() in a script on Frame 1 of your file, the command executes when the SWF file
is loaded.
For more information on the JSAPI, see www.macromedia.com/go/jsapi_info_en.
Example
The following command returns an array of objects in the library:
var libe:Array = MMExecute("fl.getDocumentDOM().library.items;");
trace(libe.length + " items in library");
Mouse class
Availability
Flash Player 5.
Description
The Mouse class is a top-level class whose properties and methods you can access without using a
constructor. You can use the methods of the Mouse class to hide and show the mouse pointer
(cursor) in the SWF file. The mouse pointer is visible by default, but you can hide it and
implement a custom pointer that you create using a movie clip (see “Creating a custom mouse
pointer” on page 94).
Method summary for the Mouse class
Listener summary for the Mouse class
Method Description
Mouse.addListener() Registers an object to receive onMouseDown, onMouseMove, and
onMouseUp notification.
Mouse.hide() Hides the mouse pointer in the SWF file.
Mouse.removeListener() Removes an object that was registered with addListener().
Mouse.show() Displays the mouse pointer in the SWF file.
Method Description
Mouse.onMouseDown Notified when the mouse button is pressed down.
Mouse.onMouseMove Notified when the mouse button is moved.
Mouse.onMouseUp Notified when the mouse button is released.
Mouse.onMouseWheel Notified when the user rolls the mouse wheel.

Table of Contents

Related product manuals