Posted By

adrianparr on 04/15/10


Tagged

variables text external load as3 URLLoader name-value-pairs URL-encoded


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

socialflasher
tspitzr


AS3 Loading Variables from an External Text File


 / Published in: ActionScript 3
 

  1. var vars:URLLoader = new URLLoader();
  2. vars.dataFormat=URLLoaderDataFormat.VARIABLES;
  3. vars.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
  4. vars.load(new URLRequest("vars.txt"));
  5. function onComplete(evt:Event):void {
  6. var urlVars:URLVariables=evt.target.data;
  7. for (var prop in urlVars) {
  8. trace("urlVars." + prop + " = " + urlVars[prop]);
  9. }
  10. }

Report this snippet  

You need to login to post a comment.