Get parameters from Javascript


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

Get parameters from a flash import


Copy this code and paste it in your HTML
  1. //Get them all
  2. try {
  3. var keyStr:String;
  4. var valueStr:String;
  5. var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
  6. for (keyStr in paramObj) {
  7. valueStr = String(paramObj[keyStr]);
  8. }
  9. } catch (error:Error) {
  10. trace(error.toString());
  11. }
  12.  
  13. //get a single one
  14. var string:String = root.loaderInfo.parameters['param'];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.