Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have an engine (air application) that basically (for now) is loading some windows on the screen/stage, and you can drag them around. And later on, I'll be able to add other objects onto the stage.

How would I export any kind of information (like co-ordinates or sizes of windows) out of my application to an external custom file. And then I would use that file to reload a previous project if I were to re-load the engine.

I'm working in AS3/Air and in FlashDevelop.

Thanks for the help and time. If anymore information is needed please let me know.


share|improve this question
up vote 1 down vote accepted

since you're creating the windows and have the drag / sizing information do you not already have the x,y, width, height information?

for saving files, AIR will allow you to do this without user prompting (what it sounds like your after) through the flash.filesystem. The AS3 should be something like the following (not tested)

import flash.filesystem.*;  

private function saveFile():void{  
    var file:File = File.desktopDirectory; // change to suit your needs  
    file= file.resolvePath("example.txt");  
    var fileStream:FileStream = new FileStream();  
    fileStream.openAsync(file, FileMode.WRITE);  
    fileStream.writeUTFBytes("Saved content!!!"); // change this for the data you want   
    fileStream.addEventListener(Event.CLOSE, fileClosed);  

function fileClosed(event:Event):void {  
   trace("closed file event!");  

Hope that helps ;-)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.