Wednesday, January 8, 2014

Flash: Custom Mouse Pointer

To create a custom mouse pointer in one of your Flash movies, we just need to add a short snippet of ActionScript to a movie clip.
  • Create a new Layer on top of all other layers.
  • Draw a "mouse pointer" of any shape, color, etc.
  • Select the pointer (I click on the keyframe to select everything)
  • Convert your pointer to a symbol (movie clip) and call it "Pointer"
  • Right-Click the new symbol and Select Actions
  • Paste the following code in the Actions
onClipEvent (load) {
Mouse.hide();
startDrag(this, true);
}
onClipEvent(mouseMove){
updateAfterEvent();
}

Test your movie (CTRL+Enter)

You may need to adjust where the "point" is on your pointer:
  • Double-click the pointer to open the clip
  • Adjust the "point" to be right on the + sign
  • You can also add animation if you would like

No comments:

Post a Comment