Removelistener (Mouse.removelistener Method) - 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

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 and stops drawing the line by
releasing the mouse button.
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);
See also
addListener (Mouse.addListener method)

removeListener (Mouse.removeListener method)

public static removeListener(listener:Object) : Boolean
Removes an object that was previously registered with
Note: This method is supported in Flash Lite only if
or
true
System.capabilities.hasStylus
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- An object.
listener:Object
Returns
- If the listener object is successfully removed, the method returns
Boolean
listener object is not successfully removed (for example, if it was not on the Mouse object's
listener list), the method returns
System.capabilities.hasMouse
is
.
true
.
false
onMouseMove
.
addListener()
and
is
; if the
true
Mouse
437

Advertisement

Table of Contents
loading

Table of Contents