Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //write an Object to a file
- private function writeObject():void {
- var object:Object = new Object();//create an object to store
- object.value = asObject.text; //set the text field value to the value property
- //create a file under the application storage folder
- var file:File = File.applicationStorageDirectory.resolvePath("myobject.file");
- if (file.exists)
- file.deleteFile();
- var fileStream:FileStream = new FileStream(); //create a file stream
- fileStream.open(file, FileMode.WRITE);// and open the file for write
- fileStream.writeObject(object);//write the object to the file
- fileStream.close();
- }
Add Comment
Please, Sign In to add comment