Couple of bits of code for saving files using AIR: This way does not open the save dialogue, just saves it automatically. var stream:FileStream = new FileStream(); var saveFile:File = new File(); saveFile = saveFile.resolvePath(String(courseStructureURL)); var fileStream:FileStream = new FileStream(); fileStream.openAsync(saveFile, FileMode.WRITE); fileStream.writeUTFBytes(String(Structure.xml)); fileStream.addEventListener(Event.CLOSE, fileClosed); fileStream.close(); function fileClosed(e:Event):void { Utils.alert("The course has been updated successfully.");... Continue Reading →
Stopping an AIR app window closing with Flash IDE AS3
If you're doing document manipulation or something you might need to confirm with the user of the app that they want to quit the app before letting them quit. To do this, there's plenty of help online if using Flex, but if writing AIR using the Flash IDE, it's slightly different. 1. Import the NativeWindow... Continue Reading →