You can embed XML just like other assets.
[Embed(source = "path/to/file.xml", mimeType = "application/octet-stream")] private const MyXML:Class;
var xml:XML = FP.getXML(MyXML);
You can embed XML just like other assets.
[Embed(source = "path/to/file.xml", mimeType = "application/octet-stream")] private const MyXML:Class;
var xml:XML = FP.getXML(MyXML);
yeah but when i embed something like that, how can i change variables after compilation? i think i got something(complete wrong) wrongā¦ thats not funny
EDIT: Ahh, is that about that āmimeTypeā thing? i see there is āstreamā word there, is that means i didnāt get something wrong?
EDIT AGAIN: reading xml only when compiling project
FINAL EDIT: Why am i not using shared object to do something like that!
āOctet streamā means the file is in binary format. Itās a little strange but Flash requires it.
Shared Objects wonāt help you here. As far as I know you canāt edit them manually and you donāt want your game data to be in that format.
If you want to change them after compilation you can use FLAKit. I didnāt realize that was what your most recent question was about.
yeap, youāre right again, shared object doesnāt help me, also iāll use this stuff for importing xml files dynamically, so, iāve just realized i can use URLLoader for thisā¦ i think this time itāll work as i wantā¦ when i complete my levels, iāll change URLloadersā to āFP.getXMLāā¦
iāve asked a little question at the beginning of this topic, but iāve learnt lots of stuff because of talkflowā¦ Even FLAKit not required to me, iāll just control entitiesā movement functions with thisā¦
Yep, URLLoader is what you want. FLAKit is really just a way for me to avoid using event listeners when I load my data, since it loads everything ahead of time. It uses URLLoaders under the hood.
I feel like this thread already has enough in it, but I wanted to suggest an alternative to your switch statement.
var worlds:Dictionary = new Dictionary();
worlds["SECTOR_41"] = SECTOR_41;
// etc.
FP.world = new worlds[levelname]();
thanks againā¦ class compiling problem solved completely iāve removed my all level classes from project file and iām working on a template level class to load any xml level, so, iām gonna publish my game with a level editor insideā¦