SHARE
TWEET

Untitled

a guest Feb 15th, 2012 38 Never
  1. import flash.events.Event;
  2. import flash.net.URLLoader;
  3. import flash.net.URLRequest;
  4. import flash.net.URLVariables;
  5. import flash.net.URLRequestMethod;
  6.  
  7. var urlLoader:URLLoader = new URLLoader ();
  8. var urlRequest:URLRequest = new URLRequest ('whatever.php');
  9. var urlVars:URLVariables = new URLVariables ();
  10.  
  11. urlVars.folder = 'path/to/folder';
  12. urlRequest.data = urlVars;
  13. urlRequest.method = URLRequestMethod.POST;
  14.  
  15. urlLoader.addEventListener (Event.COMPLETE, onComplete);
  16. urlLoader.load (urlRequest);
  17.        
  18. function onComplete (evt:Event) : void {
  19.     var xml:XML = XML (urlLoader.data);
  20.     trace (xml);
  21. }
RAW Paste Data
Top