# Javascript cookie for mute button

**URL:** <https://forum.kirupa.com/t/javascript-cookie-for-mute-button/256976>\
**Category:** Uncategorized\
**Created:** [April 9, 2008, 7:51am UTC](https://forum.kirupa.com/t/javascript-cookie-for-mute-button/256976 "2008-04-09T07:51:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kobalt7](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@kobalt7](https://forum.kirupa.com/u/kobalt7)\
**Post date:** [April 9, 2008, 7:51am UTC](https://forum.kirupa.com/t/javascript-cookie-for-mute-button/256976/1 "2008-04-09T07:51:26Z")

</div>

[[COLOR=Red]heres the download to the files[/COLOR]](http://www.kobalt7.com/mute.zip)

Im trying to create a cookie that will hold a mute variable for several swfs, im not sure of how to do it and this is not working, I was hoping someone would help me, heres the flash  
[COLOR=Gray]  
[/COLOR]

```auto
[COLOR=Gray] import flash.external.ExternalInterface;
tess = ExternalInterface.call("MyVolume");
if (tess.data.value != undefined) {
    if (tess.data.value == 1) {
        trace("off");
        bt.gotoAndStop(2);
    } else {
        trace("on");
    }
} else {
    trace("undefined");   

on (release) {
    this.gotoAndStop(2);
    tess.data.value =1
    tess = ExternalInterface.call("MyVolume");

}[/COLOR]

```

[COLOR=Gray]  
[/COLOR]  
And heres the javascript:

```auto

[COLOR=Gray]<SCRIPT LANGUAGE="JavaScript">
<!--
function setCookie(value)
{
  document.cookie = value;
}
function getCookie(value)
{
    value=getCookie('value');
if (value!=null && value!="")
  {
 return document.cookie.toString();
  }
  else 
  {
 /// username=prompt('Please enter your name:',"");
  if (value!=null && value!="")
    {
    setCookie('value',0);
    }
  }
}
}
//-->
//</SCRIPT>
[/COLOR]

```
