It is quite simple to do it, you write the object down to file, then you read it:
- http://corlan.org/2008/09/02/storing-data-locally-in-air/
- http://cookbooks.adobe.com/post_Storing_ActionScript_Objects_in_the_Encrypted_Loca-10563.html
My questions are
- why when we put [RemoteClass(alias=”foo.Bar”)] into VO, it can be
cast automatically (otherwise the type of the deserialized object is
Generic Object with correct properties data inside it)? - Is there another way to achieve it without RemoteClass tag? (Using metadata tag is preference)
Thanks
The answer is in the page you linked to:
That’s why you get a generic object if you omit the alias – the deserialization method does not know what to do with the data, unless you specify to which class the values should be mapped.
Yes, there is:
registerClassAlias()does the same thing. But the metadata tag is much prettier to read 😉