title: Help with checking for flashVars value in embed code AS3
body: <p>hoping for a bit of direction and help with a frustrating issue right now.</p>
  
  <p>Originally I thought it was a problem with my Try / Catch statement, but in reality my issue is really just trying to do a check in an If / Else statement to see if my Flash player can obtain any data from a flashVar. If flashVar VID = great, Else read from an XML file.</p>
  
  <p><strong>Basically this is what I need to have happen:</strong></p>
  
  <ul>
  <li>Check to see if there are flashVar values</li>
  <li>If so then load the other Class files and DO NOT get the XML file</li>
  <li>If not then run the code in the Catch statement and load the XML file</li>
  </ul>
  
  <p><strong>UPDATED CODE</strong> I put a lot of comments to explain what I'm trying to do :(</p>
  
  <pre><code>public function playerLive():void
  {
  // Attempt to load from HTML EMBED
  // Maybe the problem is here? 
  // Tried different syntax / keywords no luck so far
  
  //if (this.loaderInfo.parameters["VID"])
  //if (stage.loaderInfo.parameters["file"])
  //if (this.loaderInfo.parameters.hasOwnProperty("file"))
  if(root.loaderInfo.parameters.hasOwnProperty("VID") &amp;&amp; root.loaderInfo.parameters.VID != null)
  {
      // Trying keyword root
      varVid   = root.loaderInfo.parameters.VID;
      varChid  = root.loaderInfo.parameters.CHID;
      vidURL   = root.loaderInfo.parameters.file;
      vidSplit = vidURL.split(".flv")[0].split("/");
      vidTitle = root.loaderInfo.parameters.title;
      vidKey   = root.loaderInfo.parameters.keyURL;
  
      // - Trying keyword stage
      /*varVid   = stage.loaderInfo.parameters.VID;
      varChid  = stage.loaderInfo.parameters.CHID;
      vidURL   = stage.loaderInfo.parameters.file;
      vidSplit = vidURL.split(".flv")[0].split("/");
      vidTitle = stage.loaderInfo.parameters.title;
      vidKey   = stage.loaderInfo.parameters.keyURL;*/
  
      // - Trying keyword this
      /*varVid   = this.loaderInfo.parameters.VID;
      varChid  = this.loaderInfo.parameters.CHID;
      vidURL   = this.loaderInfo.parameters.file;
      vidSplit = vidURL.split(".flv")[0].split("/");
      vidTitle = this.loaderInfo.parameters.title;
      vidKey   = this.loaderInfo.parameters.keyURL;*/
  
      setup();
  
  } else {
  
      varVid  = urlVars.VID
      varChid = urlVars.CHID
      xmlURL = "http://www.howdini.com/H_player_xml.php?VID="+varVid+"&amp;CHID="+varChid;
      readXML();
  }
  
  // The old code
  /*try {
      varVid   = this.loaderInfo.parameters.VID;
      varChid  = this.loaderInfo.parameters.CHID;
      vidURL   = this.loaderInfo.parameters.file;
      vidSplit = vidURL.split(".flv")[0].split("/");
      vidTitle = this.loaderInfo.parameters.title;
      vidKey   = this.loaderInfo.parameters.keyURL;
      setup();
  
  // Facebook Player
      } catch (e) {
      varVid  = urlVars.VID
      varChid = urlVars.CHID
      xmlURL  = "http://www.howdini.com/H_player_xml.php?VID="+varVid+"&amp;CHID="+varChid;
      readXML();
      }
  }*/
  }
  
  function readXML():void
  {
      var loader:URLLoader = new URLLoader();
      loader.addEventListener(Event.COMPLETE, onXmlLoadSuccess);
      loader.addEventListener(IOErrorEvent.IO_ERROR, onXmlLoadFailed);
      loader.load(new URLRequest(xmlURL));
  }
  
  function onXmlLoadFailed(event:IOErrorEvent):void
  {
      //xml failed to load;
  }
  
  function onXmlLoadSuccess(event:Event):void
  {
      //parse your xml, then run setup;
      setup();
  }
  </code></pre>
  
  <p>What the embed code looks like (some values renamed for security reasons):</p>
  
  <pre><code>&lt;object width=450 height=292 border=0 &gt;
  &lt;embed src="http://dev.mysite.com/flvplayer_lite.swf" width="450" height="292" 
  flashvars="file=http://limelightserver.net/o18/VideoName.flv&amp;VID=13&amp;CHID=6&amp;title=Video Title&amp;keyURL=118258&amp;autostart=false&amp;showfsbutton=false&amp;c1=1&amp;c2=8430754&amp;c3=8430754&amp;c4=Category Namec5=02" type="application/x-shockwave-flash" border="0" wmode="transparent"&gt;
  &lt;/embed&gt;
  &lt;/object&gt;
  </code></pre>