PDA

View Full Version : [TUTOR] Global Cursor



suisan
22-03-2003, 07:49
In this tutorial we will create a Global mouse cursor. This cursor is perfect for a Multi scene site or Those who are looking for an alternative to the usual "start drag and hide mouse" script.
Before embarking on this tutorial you should have some basic Flash Knowledge. Launch FLASH and make sure your frame rate is at 30fps. You can edit the movie properties by going to Modify>movie .

1- We begin by drawing the cursor we would like to use. Begin by drawing something simple.
Make sure to fill the shape with a color( in this case I chose white)other wise our cursor will be transparent. Convert the desired shape into a movie clip by pressing F8 and selecting the movie clip behavior from the symbol properties panel.

http://viet-germany.net/tut/flash/cursor/1.jpg

2- Right click on the newly created movie clip and select edit. Select the shape and position it so that the upper corner of the shape looks like it's "pointing" at the crosshair.

http://viet-germany.net/tut/flash/cursor/2.jpg

3- Click on the scene tab on the upper right hand corner of the screen to return to the main timeline.

onClipEvent (load){
......Mouse.hide();
}
onClipEvent (mouseMove) {
......setProperty (this, _x, _root._xmouse);
......setProperty (this, _y, _root._ymouse);
updateAfterEvent(mouseMove);
http://viet-germany.net/tut/flash/cursor/3.jpg

4- Right click on the cursor movie clip and chose "actions". Copy and paste the Code provided. Then go to File>export. Export the movie as an SWF file.

http://viet-germany.net/tut/flash/cursor/4.jpg

5- Open up a new file by going to File>new. Draw out a circle and convert it into a button. Right click on the newly created button and chose "actions".

http://viet-germany.net/tut/flash/cursor/5.jpg

6- Go to basic actions and chose "on mouse event", select "release". Then go to Actions>load movie. Under URL type in the name, or location, of the swf you wish to load. Then chose Level 1 as location. Levels can be thought of as layers, with Level 0being your Main movie. Once the FLA has been saved to the same folder that u exported the cursor.swf to you can test out the movie.

Final:

<p align=left> <object codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 height=200 width=400 border=2 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><param name="movie" value="http://www.teamphotoshop.com/flash/tutorials/flash_mouse/main.swf">
<param name="quality" value="high">
<embed src="http://www.teamphotoshop.com/flash/tutorials/flash_mouse/main.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="400" height="200" border="2">
</embed>
</object></p>