ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > Mouse > hide (Mouse.hide method) | |||
public static hide() : Number
Hides the pointer in a SWF file. The pointer is visible by default.
Availability: ActionScript 1.0; Flash Player 5
Number - An integer; either 0 or 1. If the mouse pointer was hidden before the call to Mouse.hide(), then the return value is 0. If the mouse pointer was visible before the call to Mouse.hide(), then the return value is 1.
The following code hides the standard mouse pointer, and sets the x and y positions of the pointer_mc movie clip instance to the x and y pointer position. Create a movie clip and set its Linkage identifier to pointer_id. Add the following ActionScript to Frame 1 of the 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() method used in this example requires Flash Player 7 or later. If your SWF file includes a version 2 component, use the version 2 components' DepthManager class instead of the MovieClip.getNextHighestDepth() method.
show (Mouse.show method), _xmouse (MovieClip._xmouse property), _ymouse (MovieClip._ymouse property)
|
|
|
|