EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Onmousemove (Mouse.onmousemove Event Listener)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 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...
810 ActionScript classes
this.target_mc.clear();
this.target_mc.lineStyle(1, 0xFF0000, 100);
this.target_mc.moveTo(this.orig_x, this.orig_y);
this.target_mc.lineTo(_xmouse, this.orig_y);
this.target_mc.lineTo(_xmouse, _ymouse);
this.target_mc.lineTo(this.orig_x, _ymouse);
this.target_mc.lineTo(this.orig_x, this.orig_y);
}
updateAfterEvent();
};
mouseListener.onMouseUp = function() {
this.isDrawing = false;
};
Mouse.addListener(mouseListener);
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method.
See also
addListener (Mouse.addListener method)
onMouseMove (Mouse.onMouseMove event
listener)
onMouseMove = function() {}
Notified when the mouse moves. To use the onMouseMove listener, you must create a listener
object. You can then define a function for
onMouseMove and use addListener() to register
the listener with the Mouse object, as shown in the following code:
var someListener:Object = new Object();
someListener.onMouseMove = 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 mouse pointer as a tool to draw lines using
onMouseMove and
the Drawing API. The user draws a line when they drag the mouse pointer.
this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth());

Table of Contents

Related product manuals