Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 QuickSkills

Replacing The Cursor III (animated cursor)

 

How to replace the mouse cursor with an animated cursor:

  • Select the first frame of the "cursor" layer.
  • Open the library panel and drag the movie clip "rainbow_cursor_mc" onto the stage.
  • Then in the properties panel name the instance "rainbow_cursor_mc".
  • Double click on the movie clip instance to enter it's timeline.
    • Then in the main menu go to Control > Play.
    • In the timeline click on "Scene 1" to return to the main timeline.
  • Select the first frame of the "actions" layer.
  • Open the "actions" panel enter the following script:

onMouseMove = function(){
Mouse.hide();
rainbow_cursor_mc._x = _root._xmouse;
rainbow_cursor_mc._y = _root._ymouse;
updateAfterEvent();
}

  • Then in the main menu go to Control > Test Movie.
 

Note: In this case the mouse cursor is replaced by a multiple frame color tween movie clip called "rainbow_cursor_mc". The movie clip plays in a continuous loop as it is dragged around the stage by and invisible cursor creating the effect of a animated cursor. To learn more about how this actionscript works see [Creating An Animated Mouse Cursor Actionscript Knowledgebase].

© 2008 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us