Publishing System Settings Logout Login Register
Custom Cursor: Replace the default mouse cursor in Flash with your own!
TutorialCommentsThe AuthorReport Tutorial
Tutorial Avatar
Rating
Add to Favorites
Posted on July 23rd, 2005
14201 views
Adobe Flash
Have you ever seen those flash movies where it has its own image for your mouse cursor... maybe not but ill show you a way to make your flash movies a little more snazzy with a few tricks

There are multiple ways to achieve the final product although the way I will be doing it probably would be the easiest.

The Tutorial


1. First off create a vector shape that will represent the cursor... any shape you want is fine... you can even use a bitmap or a movie. Ill be using a triangle similar to the traditional mouse cursor seen on most computers

2. Then we select the shape or objects you would like to be in the cursor either by holding down SHIFT and then clicking whatever you want or by clicking and dragging a square around the desired objects. Then we convert it to a movieclip by right clicking your selection and clicking Convert to Symbol. Please assure yourself that the top left hand square is blacked in AND the movie clip radio button is checked like in the following example, this will stop any heartbreak in the end. Trust me.

user posted image

3. Normal click your cursor (DO NOT DOUBLE CLICK) and open the Actions panel. If you do not know how to do this simply go WINDOW->DEVELOPMENT PANELS->ACTIONS or WINDOW->ACTIONS in some versions of flash and then type in the following code

onClipEvent(enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}


4. Now test the movie :(CTRL+ENTER OR Control->Test Movie).

So what just happened?

onClipEvent(enterFrame) {


This tells the movie to do this action every frame that the movie executes

_root._xmouse


Tells the x coordinate of the movie clip to be the same as the x coordinate of the position of your mouse cusror. This is the same for the Y coordinate except the noticable difference with the letter y


It should work. If it did not please re-read the above and make sure you did exactly as mentioned.

Now you may be wondering why the normal computer cursor still appears well thats because we havnt told it to diappear yet.

5. To resolve the issue of the normal mouse cursor appearing do the following: Normal click the first frame that the cursor appears at

user posted image

Now go into the Actions panel once again. and type

Mouse.hide()



This simply hides the cursor from this frame onwards.. to reshow the normal cursor type

Mouse.show()


6. Now If the mouse cursor is laggy and doesnt follow your mouse at the requird speed double click the area pointed out in the following image:

user posted image

A window should appear now. In the frame rate box type in 30, the original number would probably be 12. This is the numer of times per second we want the cursor to reposition itself or run the first script.

Now if you excuse me I think ill go and see "War of the Worlds" by Steven Spielberg at the cinema :)

Example







To download the .fla source file click here

Conclusion


The movie should now work the way you want, to test it simply go CONTROL->Test Movie or hold down the CTRL-ENTER buttons simultaniously
Premium Publisher
Dig this tutorial?
Thank the author by sending him a few P2L credits!

Send
pr0jekt

Hello World!
I am a 17 Year old student from South
Australia. Im a web developer and
programmer most of the day when im not
sleeping :).
I also work on the Pipeline Content
Managment System and Forums.
View Full Profile Add as Friend Send PM
Pixel2Life Home Advanced Search Search Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Pixel2life Homepage Submit a Tutorial Publish a Tutorial Join our Forums P2L Marketplace Advertise on P2L P2L Website Hosting Help and FAQ Topsites Link Exchange P2L RSS Feeds P2L Sitemap Contact Us Privacy Statement Legal P2L Facebook Fanpage Follow us on Twitter P2L Studios Portal P2L Website Hosting Back to Top