flash (macromedia):
I currently have a movie that includes a simple on/off audio player. At the end of the movie it has a script to goto 4 and loop from there. Problem is if the viewer hits the sound off button it will turn the sound off untill the movie loops and then it automatically starts the audio. The viewer would then have to hit play again and then stop to stop it. how can i fix this...thanks
use a boolean variable within the method you're using to turn off or on the audio, and set it to the corresponding value. Then at frame 4, add a conditional statement that determines what the current value is and reset the audio there.
Thanks...can you give me an example? i have an off button within my audio player Movie which states: on (release) { gotoAndStop(11); }
sure. Previous to frame 4, declare a variable, and a global Sound Object ... var mute:Boolean = false; var control:Sound = new Sound(); ... now, it looks as though you have a single button, so I'm assuming you want it to 'toggle', click it and the sound goes off, click it again and sound goes back on, and so on. So you will need to set this up within the button as well. so within the button's handler use ... on(release) { if(_parent.mute) { _parent.mute = false; gotoAndStop(11); //not sure where this is going }else{ _parent.mute = true; gotoAndStop(?); //I don't know where your going here } } ... now on frame 4, you would use the conditional statement to determine if the mute is on or not, I also do not know what Sound Object you are using or if you have this sound on the timeline, or how you are controling the audio at all, so I'll use the global Sound Object to control the volume here ... if(mute) { control.setVolume(0); }else{ control.setVolume(100); } ... there you go :) this should be close, but it's difficult to tell without knowing more about the structure of your document.
I'm not sure, I don't know enough about your structure here, I'd said 'frame4' because you'd said that was where the loop went back to. But thats the key, where ever the loop goes back to ... that's where you want to place the condition to determine if it should be on or off. I think it sounds like it should be in the main movie.
Don't see what you're looking for? Try a search.
|