Store it however you want, though a lot of people seem to prefer JSON to XML recently.
Whether it's good practice - I'm not sure what you mean. You're just storing volatile data, whether it's in XML or your own format is irrelevant.
At 10/6/14 08:34 AM, Sam wrote: Store it however you want, though a lot of people seem to prefer JSON to XML recently.
Whether it's good practice - I'm not sure what you mean. You're just storing volatile data, whether it's in XML or your own format is irrelevant.
Should've used differnt wording, I didn't mean database as something outside the program, but a data collection the program uses during runtime, so it uses alot of it, so I guessed it might impact performance.
At 10/6/14 09:04 AM, NecroBlight wrote: Should've used differnt wording, I didn't mean database as something outside the program, but a data collection the program uses during runtime, so it uses alot of it, so I guessed it might impact performance.
What you're talking about is just some sort of data structure. The benefit of the XML and JSON formats is that they are easily readable by people.
As far as I know, AS3 doesn't have a "type" of JSON, so you'd have to store it as a string and parse it into some data type that's more suitable than a string that AS3 does have before modifying it, and then encode it to a JSON string before writing it back to your variable (essentially writing your own interface between JSON and an AS3 data type, but I'm sure there are third-party classes). I do know AS3 has an XML object but it all depends on what your requirements are.
Considering it's volatile and will be lost once the application is closed, will a human ever read this data? If not, consider the use of an array or something that AS3 already has.
Not really. XML is designed to be easily readable to humans, so it's likely going to be slower than using other types. If you want something you can assign String keys to then look into Dictionary.
Quick example:
var d:Dictionary = new Dictionary();
d["myName"] = "MintPaw";
d["flashPlayerVersion"] = 15;