# AS2:SharedObject, Unable to start sound back after refresh

**URL:** https://forum.kirupa.com/t/as2-sharedobject-unable-to-start-sound-back-after-refresh/300617
**Category:** flash
**Created:** [November 24, 2009, 5:37pm UTC](https://forum.kirupa.com/t/as2-sharedobject-unable-to-start-sound-back-after-refresh/300617 "2009-11-24T17:37:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wuzzi2ya](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wuzzi2ya](https://forum.kirupa.com/u/wuzzi2ya)
#### Post date: [November 24, 2009, 5:37pm UTC](https://forum.kirupa.com/t/as2-sharedobject-unable-to-start-sound-back-after-refresh/300617/1 "2009-11-24T17:37:07Z")

</div>

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:

```auto
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!
