Mouse.onMouseUp
Availability
Flash Player 6.
Usage
someListener.onMouseUp
Parameters
None.
Returns
Nothing.
Description
Listener; notified when the mouse is released. To use the
listener 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.onMouseUp = function () { ... };
Mouse.addListener(someListener);
Listeners enable different pieces of code to cooperate because multiple listeners can receive
notification about a single event.
Example
The following example uses the mouse pointer as a tool to draw lines using
Drawing API. The user draws a line when they drag the mouse pointer. The user stops drawing
the line when they release 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
Mouse.addListener()
listener, you must create a
onMouseUp
and use
onMouseUp
addListener()
to register
and the
onMouseMove
Mouse.onMouseUp
483
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers