MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 811

Actionscript 2.0 language reference
Table of Contents

Advertisement

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);
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
The following example hides the standard mouse pointer, and sets the x and y positions of the
movie clip instance to the x and y pointer position. Create a movie clip and set its
pointer_mc
Linkage identifier to
Timeline:
// to use this script you need a symbol
// in your library with a Linkage Identifier of "pointer_id".
this.attachMovie("pointer_id", "pointer_mc", this.getNextHighestDepth());
Mouse.hide();
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
pointer_mc._x = _xmouse;
pointer_mc._y = _ymouse;
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
addListener (Mouse.addListener method)
MovieClip.getNextHighestDepth()
. Add the following ActionScript to Frame 1 of the
pointer_id
MovieClip.getNextHighestDepth()
method used in this example requires Flash Player
method used in this example requires Flash Player
method.
method.
Mouse
811

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF