Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sound ON/OFF in Flash movie 1

Status
Not open for further replies.

Blockhead

Programmer
May 10, 1999
3
US
Hi. I'm trying to implement a feature in a Flash movie that allows a user to either view the animation with or without sound. Could anyone advise a simple approach to tackle this problem?<br>
I'm not seeing any easy fix. Thanks!<br>
<br>
-Blockhead
 
The easiest way would be to create a button and assign an action to it. This action would be &quot;Stop All Sounds.&quot;<br>
<br>
Getting it to play again, that's a different story. Do you want it to start again where it left off or do you want the sound to start over again?
 
Yes, I am trying to implement the feature of the audio stopping thoughout the movie. When stopped, I would like for it to start again &quot;near&quot; where it left off. Thanks for any help you can give me.
 
I can only think of one solution at the moment but may have another idea soon with something else that I am trying to find out.<br><br>1st of all, you've got to set the sound to stream.&nbsp;&nbsp;If it's an event, as soon as you turn it off, you've lost it's position really, whereas the stream will run along side the frames of your scene.<br><br>OK, if you can imagine that you have your scene all laid out in frames and is nice and complete.&nbsp;&nbsp;Lable this whole scene at the begining key frame as, say, &quot;area 1&quot;.&nbsp;&nbsp;Put a stop control at the last key frame to stop the scene when it reaches the end.<br><br>Now copy and paste all these frames, the whole scene onto a new layer, let me know if you can't do that.&nbsp;&nbsp;Paste them on a new key frame just after the original scene has finished.<br>Lable the 1st key frame of this new area, &quot;area 2&quot;.<br><br>What we are going to do is load area 1 with streaming sound and area 2 without.<br><br>When your button is pressed to cut the sound, it needs to be loaded with &quot;On press, goto _currentframe + (how ever many frames your original movie is).&nbsp;&nbsp;This will jump to the same frame in the identicle scene, but one without sound.<br><br>Repeate these instructions in your area 2 button, but with goto _currentframe - (No. of frames).&nbsp;&nbsp;This will jump back to identicle frame, continue playing and give you sound.<br><br>TIP...Watch out for movie clips.&nbsp;&nbsp;If you are jumping from area to area, you may have to tell certain movie clips to stop or start and would have to create more key frames on your button layer, in order to give seperate command to the same button, depending upon where it is in the time line.&nbsp;&nbsp;If you are doing this, let me know a nd I have n easier solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top