Using AS3 SharedObject in Flash for sound

Need a cookie for sound to keep it from playing everytime the page is visited and or navigated away from and back to…

Okay I have moved on to this, but alas it still doesnt work… ANY feedback would help tremendously…

import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.media.SoundChannel;
import flash.media.SoundMixer;
import flash.net.SharedObject;
var so:SharedObject = SharedObject.getLocal("userPref");

SoundOff.addEventListener(MouseEvent.CLICK, StopTheSound);
function StopTheSound(event:MouseEvent):void {
    //SoundMixer.stopAll();
    var s:SoundTransform = new SoundTransform();
    s.volume = 0;
    SoundMixer.soundTransform = s;
    if (so.data.stopped == undefined) {
        s.volume = 1;
    } else {
        s.volume = 0;
    }
}