Posted on July 23rd, 2005
14201 views
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 Tutorial1. 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. 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 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: 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 ConclusionThe movie should now work the way you want, to test it simply go CONTROL->Test Movie or hold down the CTRL-ENTER buttons simultaniously |