mouseListener.onMouseWheel = function(delta:Number) {
line_mc._rotation += delta;
};
mouseListener.onMouseDown = function() {
trace("Down");
};
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)
(TextField.mouseWheelEnabled property)
removeListener (Mouse.removeListener method)
public static removeListener(listener:Object) : Boolean
Removes an object that was previously registered with
Availability: ActionScript 1.0; Flash Player 6
Parameters
- An object.
listener:Object
Returns
- If the
Boolean
listener
is not successfully removed (for example, if the
listener
object's listener list), the method returns
Example
The following example attaches three buttons to the Stage, and lets the user draw lines in the
SWF file at runtime, using the mouse pointer. One button clears all of the lines from the
SWF file. The second button removes the mouse listener so the user cannot draw lines. The
third button adds the mouse listener after it is removed, so the user can draw lines again. Add
the following ActionScript to Frame 1 of the Timeline:
this.createClassObject(mx.controls.Button, "clear_button",
this.getNextHighestDepth(), {_x:10, _y:10, label:'clear'});
this.createClassObject(mx.controls.Button, "stopDrawing_button",
this.getNextHighestDepth(), {_x:120, _y:10, label:'stop drawing'});
this.createClassObject(mx.controls.Button, "startDrawing_button",
this.getNextHighestDepth(), {_x:230, _y:10, label:'start drawing'});
814
ActionScript classes
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
,
object is successfully removed, the method returns
.
false
mouseWheelEnabled
addListener()
was not on the Mouse
listener
method.
.
; if the
true
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?