flashvars / querystring variables


/ Published in: ActionScript 3
Save to your folder(s)

Accessing QueryString variables or flashvars


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.