all groups > flash actionscript > june 2005 >
You're in the

flash actionscript

group:

Multi-Function Button?


Multi-Function Button? C H
6/20/2005 9:47:19 PM
flash actionscript:
I have a simple animation that plays on the stage. Behind the animation I put a
button so that the entire stage is, essentially, a button. What I want to do,
is when someone clicks on the button the movie stops, and then when they click
it again, it starts again where it left off. The button is hidden by the
animation, so the user will have to click on the animation to pause it. Then
when they click a second time, the animation restarts where it left off. I
would like for it to work through out the entire timeline, so that no matter
where the playhead is at, when a user clicks, the animation pauses until they
click again, and the animation restarts where it was--regardless of how many
times they have done this action during the animation. This seems like a very
simple problem, but I can;t figure it out. Thanks in advance.

C
Re: Multi-Function Button? Offroader
6/20/2005 9:56:40 PM
There are lots of ways to do this. One is

_global.Playing = true

on (release)
{
if (Playing)
stop()
else
play();
Playing = !Playing;
}
Re: Multi-Function Button? C H
6/20/2005 10:18:31 PM
Thanks for the quick reply. I knew it was an easy solution--thanks so much for showing me! It works beautifully.

AddThis Social Bookmark Button