On/Off button for streaming sound. Video is synced with audio

Hi,

I have a Flash movie that contains a streaming soundtrack. I want to have an on/off switch to toggle, BUT, instead of having it either start from the beginning of the song each time, or where it was paused from, I’d like it to start up where the correct amount of time has elapsed. In other words, the sound is synced to the video, and unless it remains on a strict timeline, it will ruin the effect.

Is this possible to do? Please let me know the easiest way to do this, be it AS2 or AS3. Thanks!

(P.S. I’m pretty new to Action Script, so be gentle)

you know a really easy way to do that would be to just turn the volume of the sound all the way down then raise it back up when you want to. don’t know if this is how you are working it but…

yourSound = new Sound ( );
yourSound.attachSound (“LinkageToSound”);
yourSound.setVolume (100);
yourSound.start (0);

when you want to turn the sound down to simulate the stop just do this…
yourSound.setVolume(0);

to turn it back up do this…
yourSound.setVolume(100);

That sound like a great idea. Forgive my AS ignorance, but how do I apply that to a button?


[quote=_name;2350474]you know a really easy way to do that would be to just turn the volume of the sound all the way down then raise it back up when you want to. don’t know if this is how you are working it but…

yourSound = new Sound ( );
yourSound.attachSound (“LinkageToSound”);
yourSound.setVolume (100);
yourSound.start (0);

when you want to turn the sound down to simulate the stop just do this…
yourSound.setVolume(0);

to turn it back up do this…
yourSound.setVolume(100);[/quote]