Load URL variable from HTML link


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



Copy this code and paste it in your HTML
  1. import flash.external.ExternalInterface;
  2. import flash.net.URLVariables;
  3.  
  4. public function readVariable(variable:String):String {
  5. var fullurl:String = ExternalInterface.call("window.location.href.toString");
  6. fullurl ? null : fullurl = "";
  7. var variablesUrl:URLVariables = new URLVariables(fullurl.split("?")[1]);
  8. variablesUrl[variable] ? null : variablesUrl[variable] = "";
  9. return variablesUrl[variable];
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.