Search Tutorials
First select your custom cursor movieclip and choose 'Actions' from the 'Windows' menu.
Make sure you're dealing with Object Actions. NOT with frame actions.
Then add the following code to the Object Actions of your cursor clip:
onClipEvent (load) {
// hide mousecursor
Mouse.hide();
}
onClipEvent (enterFrame) {
// update clip position continuously
this._x = _parent._xmouse;
this._y = _parent._ymouse;
}
onClipEvent (unload) {
// show mousecursor if/when this clip is removed.
Mouse.show();
}
The load event hides the mouse the instance the clip is loaded into the timeline. A load event only occurs once. It is executed the moment the cursor clip appears onto the timeline. The enterFrame event continuously checks the position of the mousepointer on the main timeline and updates the x and y position of the cursor movieclip (this) accordingly. The unload event makes sure the original mouse appears when the custom cursor is removed from the timeline. An unload event also occurs only once. Have fun.. Download my file to see it work!! | |||||||||||||