Create Flash Buttons that animate after being clicked?

Hi

I assume that this question has a simple answer, but days of searching the net hasn't helped me. I'm relatively new to Flash - or at least this aspect of the program.

Okay, what I want is a button that continues to animate (once only) AFTER it has been clicked. Right now I have to keep the mouse pressed down for the animation to play, because I put the movie clip in the down state.

Because it's a website the buttons are the same on every page and I want the animation to finish even if the next scene has loaded already. I want the animation to play once only.

I've seen many Flash sites that animate while the next page/scene loads. How do I do this?


Thanks in advance to any helpful people.
-dissonant
dissonantAsked:
Who is Participating?
 
OBCTCommented:
http://www.wren-intermedia.com/ee/button_mc.fla

Take a look at that and then try using the same actions in your fla

Cheers

-OBCT
0
 
OBCTCommented:
dissonant ,

My suggestion is, that you should make your button a movie clip then give it the instance name of "button1" or anything you want. Make 3 keyframes in that movie clip. The first one for what you want the button to look like, on the second frame make it look like what ever you want for the "over", then on the third make the "down" button.
On each of those 3 keyframes add this code:      stop();
Make another keyframe in that movie clip on frame 4. Here you can add your animation but if you only want it to play once, then make sure its a motion tween and add "stop();" to the first and last keyframe for the tween.
Now go back to your main scene, click the movie clip and add this code:

on (rollOver) {
     _root.button1.gotoAndStop(2);
}
on (press) {
     _root.button1.gotoAndStop(3);
}
on (release) {
     _root.button1.gotoAndPlay(5);
}

What this code does is tell flash where to go when certain actions are performed.
The _root.button1  means "_root." is the main movie and "button1" is the instance name of your movie clip.
The gotoAndStop(2); tells flash to goto frame 2 and stop.
_root.button1.gotoAndPlay(5); tells flash to go to the frame after the stop() action and play it. Because you have a stop() action at the end of the motion tween, it will only play once.
If you want me to give you the source code, just let me know.

Cheers

-OBCT
0
 
dissonantAuthor Commented:
Yeah, could I get the source off you? I tried it and the button doesn't react at all. The animation is keyframe, not tween, could that be the problem?

dale@australiamail.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.