Creating a new cursor
With the knowledge we have been accumulating to that point we are going to be able to replace the default mouse cursor and to create a new one. We are using the same movie than the one we used previously, in the code I have greyed out the previous code, as you can see it is very straightforward to change the aspect of the mouse cursor, the steps are :
1. We hide the normal mouse cursor using the hide method of the Mouse class. Note that to show it again you will need to use the show method.
2. Once the normal cursor is hidden we make sure that each time the mouse is moved we update the coordinates of the movie clip that we use to replace the normal cursor, this is done with the 2 lines :
cursor. _x = _xmouse;
cursor. _y = _ymouse;
3. Again we use updateAfterEvent to force a screen refresh for a smoother display of the cursor as it moves.
|
Mouse.hide();
cursor._x = _xmouse;
cursor._y = _ymouse;
updateAfterEvent();
|
Good luck :)
|