Onmousemove (Mouse.onmousemove Event Listener) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

onMouseMove (Mouse.onMouseMove event
listener)
onMouseMove = function() {}
Notified when the mouse moves. To use the
object. You can then define a function for
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.
Note: This event listener is supported in Flash Lite only if
is
.
true
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example uses the mouse pointer as a tool to draw lines using
the Drawing API. The user draws a line by moving the pointer.
this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth());
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
this.isDrawing = true;
canvas_mc.lineStyle(2, 0xFF0000, 100);
canvas_mc.moveTo(_xmouse, _ymouse);
};
mouseListener.onMouseMove = function() {
if (this.isDrawing) {
canvas_mc.lineTo(_xmouse, _ymouse);
}
updateAfterEvent();
};
mouseListener.onMouseUp = function() {
this.isDrawing = false;
};
Mouse.addListener(mouseListener);
listener, you must create a listener
onMouseMove
and use
onMouseMove
System.capabilities.hasMouse
to register
addListener()
onMouseMove
Mouse
and
435

Advertisement

Table of Contents
loading

Table of Contents