all groups > flash (macromedia) > october 2007 >
You're in the

flash (macromedia)

group:

Looping Movie Audio Issue


Looping Movie Audio Issue tj3182
10/1/2007 8:34:10 PM
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
Re: Looping Movie Audio Issue clbeech
10/1/2007 9:25:44 PM
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.
Re: Looping Movie Audio Issue tj3182
10/2/2007 3:47:10 PM
Thanks...can you give me an example? i have an off button within my audio player Movie which states:

on (release) {
gotoAndStop(11);
}
Re: Looping Movie Audio Issue clbeech
10/2/2007 4:19:52 PM
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.
Re: Looping Movie Audio Issue tj3182
10/2/2007 4:42:24 PM
thanks ill try that:

here's where the flash element is located

www.fourwindscasino.com/test/index.asp

Re: Looping Movie Audio Issue tj3182
10/2/2007 4:44:36 PM
Re: Looping Movie Audio Issue clbeech
10/2/2007 5:00:33 PM
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.
Re: Looping Movie Audio Issue tj3182
10/2/2007 6:41:40 PM
Re: Looping Movie Audio Issue clbeech
10/2/2007 6:52:18 PM
AddThis Social Bookmark Button