First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Chris Lawlor | Website: http://www.delerium.tk

First things first
------------------
To understand this tutorial properly, it's best to have a basic knowledge of hte "_root." action and Clip events such as "mouseDown" and "mouseUp". If you have a basic knowledge of these actions this turorial should be easy to understand :). You should switch your actions panel to "Expert Mode" if it isn't already. Don't forget to name all the objects in the instance, the symbol name doesn't really matter.

The Mallet Cursor
-----------------
In this section, were going to make an interactive mallet cursor, when the left mouse button is pressed down, the mallet will swing down, when it is released, the mallet willl return to it's originak position.

STEP 1)

First of all, you'll need to draw your self a simple mallet, it should just have a handle and the head. You can paint it any funky colour you want :).

STEP 2)

Convert the drawing into a Graphic, call it whatever you want, I called mine "M".

STEP 3)

select the mallet graphic on the stage and convert it into a Movie Clip, you can call it whatever you like. Go back to scene 1 on the stage and select the instance name box of the movie clip. Call it "mallet". Right-click the movie clip and add the following actions to it:

onClipEvent (load) {
	startDrag(this, true);
}

STEP 4)

Now here's the fun bit, double click the mallet movie clip to access it's timeline. On the first frame of the movie clip, write the action:

stop();

On the next few frames, create a small animation of the hammer swinging downwards, you can add a sound if you like. On the last frame of the animation, put the action as:

stop();

After the second stop frame, create another small animation of the mallet swinging back up to it's original position, the position must be the same as it it at the start of te movie clip, the best way to make sure of this, is to go back to the first frame of the movie clip and press CTRL+C on the mallet graphic, and te go back to the last frame, right click anywhere on the stage and select "Paste In Place" from the menu. On the last frame of the hammer swinging back up animation, write the action:

gotoAndPlay(1);

STEP 5)

Go back to the main timeline and create an invisible movie clip at the side of the stage where it cannot be seen when the movie is exported, you can put anything you like because nobody can see it, I just drew a square. Convert your shape into a movie clip, it doesnt amtter about the instance name or symbol name because it is only used for script.

Add the following actions to the movie clip:

onClipEvent(mouseDown) {
_root.mallet.gotoAndPlay(2);
}

Just underneath that write the following:

onClipEvent(mouseUp) {
_root.mallet.gotoAndPlay();
}

You'll notice that i've left te gotoAndPlay frame number blank, in the space, you have to put the frame number that is the starting frame of your mallet swinging back up animation.

STEP 6)

Now you're done! There you have your very own mallet cursor. Hope you enjoy it. :)

» Level Intermediate

Added: 2003-08-13
Rating: 6 Votes: 33
(10 being the highest)
» Author
Feel fee to use my tutes 4 anything u want, dont 4get 2 visit my site if ya can www.delerium.tk
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: doc_chin7
» Description:

The flash's horizontal road drive was done in CS4 and was upgraded to CS6. The car responds to right/ left key and flash will auto-generate the movement of roads from left-right or right-left based on random number. Have fun driving in this virtual environment and avoid other cars... :) If you are creative, a road driving game can be created from it.

Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.