all groups > flash actionscript > february 2004 >
You're in the

flash actionscript

group:

making paused sounds resume where they left off


making paused sounds resume where they left off zackg3
2/3/2004 10:46:42 PM
flash actionscript:
Hello. I needed to make a tutorial CD which involved sound and animation. I had to time the animation to the sounds by making the playback head pause for a specific duration on certain frames and then move on, which i did with a simple loop for X seconds script. The problem is that I need to be able to hit one button to pause the entire movie, including the sound, and then have another button to resume the movie. I converted the entire movie to quicktime movie so that it would have the stop, pause, and play buttons, but when you hit pause, then resume, it doesn't pick the audio back up. what happens is you don't hear anything until a new auio track comes on. Is there a fix for this? Perhaps there is no need to convert to quicktime, but i just can't seem to get one button to pause the whole movie and then another to resume right where the sound left off.

Re: making paused sounds resume where they left off zackg3
2/4/2004 4:38:40 AM
Thanks for your help. I made the animation and sound into a movie clip, then I made two buttons (stop and play) and assigned the MC.stop(); and MC.play(); to them, but when I tested it, they didn't stop or play the clip. Was I supposed to exchange MC with the name of the clip? or is there a place where I set the name of the clip? thanks in advance.

zack

Re: making paused sounds resume where they left off urami_
2/4/2004 6:49:14 AM

[quoted text, click to view]

The easiest is to place the sound as stream in movie clip, all you need than is MC.stop(); and
MC.play();
Stream is timeline based so once stopped it simply pause by default .



Regards


urami_*

<xmas>
http://flashfugitive.com/
</xmas>

Re: making paused sounds resume where they left off urami_
2/4/2004 3:19:47 PM

[quoted text, click to view]

you must give movie clip Instance name , right click it and go to properties , if you use MX 2004
than there no longer is Properties option , you will need to click on the mc and hit CTRL F3.
In that properties panel is window where you key in the instance name .
the MC is just instance name sample, you can call it anything you like.



Regards


urami_*

<xmas>
http://flashfugitive.com/
</xmas>

Re: making paused sounds resume where they left off zackg3
2/4/2004 11:43:00 PM
I finally got it to work. Thanks for your help. Actually, I got it working slightly differently. I made the sound in the movie clip stream like you said. Then I made the two buttons. For the first button, I selected it, then in the actions panel, I clicked on variables, then double-clicked "with". Once itcreated a small line of code, I selected the part highlighted in red ("not yet set") and then hit the target icon (crosshairs) and selected the movie clip, which I previouslygave a name in the property inspector (important). Then after i identified the movie clip, I set a play action. I did the same thing for the stop button, and they worked like a charm.

AddThis Social Bookmark Button