updateAfterEvent();
};
Mouse.addListener(mouseListener);
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
See also
show (Mouse.show method)
(MovieClip._ymouse property)
onMouseDown (Mouse.onMouseDown event
listener)
onMouseDown = function() {}
Notified when the mouse is pressed. To use the
listener object. You can then define a function for
register the listener with the Mouse object, as shown in the following code:
var someListener:Object = new Object();
someListener.onMouseDown = function () { ... };
Mouse.addListener(someListener);
Listeners enable different pieces of code to cooperate because multiple listeners can receive
notification about a single event.
A Flash application can only monitor mouse events that occur within its focus. A Flash
application cannot detect mouse events in another application.
Availability: ActionScript 1.0; Flash Player 6
Example
The following example uses the Drawing API to draw a rectangle whenever the user clicks,
drags and releases the mouse at runtime.
this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth());
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
this.isDrawing = true;
this.orig_x = _xmouse;
this.orig_y = _ymouse;
this.target_mc = canvas_mc.createEmptyMovieClip("",
canvas_mc.getNextHighestDepth());
};
mouseListener.onMouseMove = function() {
if (this.isDrawing) {
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
,
_xmouse (MovieClip._xmouse property)
onMouseDown
onMouseDown
method.
,
_ymouse
listener, you must create a
and use
addListener()
Mouse
to
809
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?