I have a toggle to mute and unmute sound in this movie. If sound is on and refresh with SharedObject sound plays again. Also I can toggle between the sound before refresh. The issue: when selecting mute then refresh, the movie plays back muted but the ability to un-mute is no longer available (at least not before another refresh).
Problem: toggle to mute then refresh of browser. Mute is fine but no ability to toggle back to sound.
Code:
var my_snd_obj:Sound = new Sound();
my_snd_obj.start(0,1);
my_snd_obj.attachSound("my_audio");
my_snd_obj.setVolume(15);
var my_so:SharedObject = SharedObject.getLocal("userPref");
if (my_so.data.stopped == undefined) {
my_snd_obj.start(0,1);
my_snd_obj.setVolume(15);
stateCopy._visible = false;
trace("stopped == undefined");
} else {
my_snd_obj.setVolume(0);
trace("else");
}
var volumeOn:Boolean = true;
btnSoundOff.onRelease = function():Void {
if (volumeOn) {
my_so.data.stopped = 1;
my_snd_obj.setVolume(0);
my_so.flush();
stateCopy._visible = true;
trace("stopped == 1 " + my_so.data.stopped);
} else {
my_snd_obj.setVolume(15);
my_so.clear();
stateCopy._visible = false;
trace("stopped == else 1" + my_so.data.stopped);
}
volumeOn = !volumeOn;
};
Any suggestions? Any and all help is greatly appreciated!