Posted By

shuchii on 05/27/11


Tagged

querystring var flashvar


Versions (?)

flashvars / querystring variables


 / Published in: ActionScript 3
 

Accessing QueryString variables or flashvars

  1. // Suppose your URL looks like this: http://www.your-domain.com?varName=varValue
  2.  
  3. // First of all, you should add this piece of code
  4. // to the HTML file that's embedding your swf.
  5. // ! Your SWF should be embedded through the SWFObject class!
  6. // swfObject.addVariable("varNameInFlash", "<?=$_GET["varName"]?>");
  7.  
  8. trace(this.loaderInfo.parameters.varNameInFlash); // output will be varValue

Report this snippet  

You need to login to post a comment.