A custom cursor can be created in Flash by hiding the user's mouse pointer and replacing it with a dragging movie clip. When the cursor leaves the area of the Flash movie, it returns to the original default cursor.

To hide the standard cursor, you use thehidemethod of the predefined Mouse object. To use a movie clip as the custom cursor, you use thestartDragaction. The steps below explain this process.

To create a custom cursor, do the following:

1 Create a movie clip to use as your custom cursor. Make sure one instance of the movie clip is present on the stage.
2 Select the Movie clip instance on the stage.
3 Choose Window> Actions to open the Object Actions panel.
4

In the Toolbox list, select Objects, then select Mouse, and double-clickhide.

The Script window should look like the image below.

5

In the Toolbox list, select Actions; then double-clickstartDrag. Select the Lock Mouse to Center box.

Note:In this example, leaving the Target blank will function correctly. The Target can also be specified by entering "this" into the Target field, and selecting the "Expression" checkbox in the Parameters pane.

6

Choose Control > Test Movie to use the custom cursor.





Keywords: tn_14688

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy