title: How to read an HTML cookie in Flash?
body: <p>I'm hoping to get pointed in the right direction here. The problem I'm having is trying to figure out how to read an HTML created cookie in Flash. I have a video player that should autoplay once in a 24hour period, the next day it should autoplay again for the end-user.</p>
  
  <p>This is what the script on the HTML page looks like that displays the Flash player and the cookie:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var so = new SWFObject("flvplayer.swf", "mymovie", "640", "394", "8", "#90ab69");
  var x = readCookie('homepageIntro') // &lt;- The Cookie (How do I read this in Flash?)
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.useExpressInstall('expressinstall.swf');
  so.addVariable("autostart", "false");
  so.addVariable("file", "video.flv");
  so.addVariable("key", "");
  so.addVariable("showfsbutton", "false");
  so.addVariable("noControls", "false");
  so.addVariable("home", "true");
  so.write("flashcontent");
  &lt;/script&gt;
  </code></pre>
  
  <p>Not knowing how to read that <code>var x</code> inside of Flash, I tried to get around having to use it by using a Flash cookie, however now the video player will only ever autoplay once and never ever autoplay again(unable to clear the Flash cookie).</p>
  
  <pre><code>public function sharedObjectCheck():void
  {
      if (mySharedObject.data.flashCookie == "true"){
          //Code to NOT autoplay video
      } else if (mySharedObject.data.flashCookie == null){
          mySharedObject.data.flashCookie = "true"; //if first time, set the cookie value
          mySharedObject.flush(); //add the cookie
      }
  }
  </code></pre>
  
  <p>I did some searching and found this <a href="https://stackoverflow.com/questions/1108549/have-a-html-page-play-flash-movie-only-once-not-when-revisited">Have a HTML page play Flash movie only once (not when revisited…)</a> but again this is just a Flash function which never allows for a restart in a certain time period.</p>
  
  <p>So my question to my fellow Flash stackers is how do I read that <code>var x</code><em>(cookie)</em> in Flash?</p>