Posted By

burakkirkil on 07/29/12


Tagged


Versions (?)

Writing FlashVars to TextField


 / Published in: ActionScript 3
 

For FlashVars testing on screen

  1. var tf:TextField = new TextField();
  2. tf.autoSize = TextFieldAutoSize.LEFT;
  3. tf.border = true;
  4. addChild(tf);
  5. tf.x = 200;
  6. tf.y = 200;
  7. tf.multiline = true;
  8. tf.height = 200;
  9.  
  10. tf.appendText("params:" + "\n");
  11. try {
  12. var keyStr:String;
  13. var valueStr:String;
  14. var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
  15. for (keyStr in paramObj) {
  16. valueStr = String(paramObj[keyStr]);
  17. trace(this, "flashVars->", keyStr, valueStr);
  18. tf.appendText("\t" + keyStr + ":\t" + valueStr + "\n");
  19. }
  20. } catch (error:Error) {
  21. tf.appendText(error.toString());
  22. }

Report this snippet  

You need to login to post a comment.