Posted By

BoNzO on 01/07/10


Tagged

AIR as3


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

sidneydekoning
Demian
tspitzr


Save remote rss on desktop in Air AS3


 / Published in: ActionScript 3
 

  1. import flash.filesystem.File;
  2. import flash.filesystem.FileMode;
  3. import flash.filesystem.FileStream;
  4.  
  5. var file:File = File.desktopDirectory.resolvePath( "file.txt" );
  6. var stream:FileStream = new FileStream();
  7. var xmlLoader:URLLoader = new URLLoader();
  8.  
  9. xmlLoader.addEventListener(Event.COMPLETE, onLoaded);
  10.  
  11. function onLoaded(e:Event):void {
  12. stream.open( file, FileMode.WRITE );
  13. stream.writeUTFBytes(e.target.data);
  14. stream.close();
  15. file = null;
  16. stream = null;
  17. }
  18.  
  19. xmlLoader.load(new URLRequest("http://www.yourfeedurl.com/file.xml"));

Report this snippet  

You need to login to post a comment.