I said lets make a custom mouse cursor. That implies that it replaces the mouse. So we need to hide the mouse, add the code Mouse.hide(); to the 1st line in the actions panel.
Mouse.hide();
Custom Mouse Pointer
1. Create a movie clip to use as a custom pointer, and place an instance of the clip on the Stage.
2. Select the movie clip instance on the Stage.
3. In the Property inspector, type cursor_mc in the Instance Name text box.
4. Select Frame 1 of the actions layer, and type the following code in the Actions panel after the Mouse.hide code:
function onMove (motion:MouseEvent):void {
instance_name.x = mouseX;
instance_name.y = mouseY;
};
stage.addEventListener (MouseEvent.MOUSE_MOVE, onMove);
Buttons still function when you use a custom mouse pointer. It's a good idea to put the custom pointer on the top layer of the timeline so that, as you move the mouse in the SWF file, the custom pointer appears in front of buttons and other objects in other layers. Also, the tip of a custom pointer is the registration point of the movie clip you're using as the custom pointer. Therefore, if you want a certain part of the movie clip to act as the tip of the pointer, set the registration point coordinates of the clip to be that point.
Wednesday, November 12, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment