Flash XML question
- Started
- Last post
- 11 Responses
- Chadwick
Does anyone know if it's possible and how to compile a Flash swf with an XML document? in other words, keep the xml doc inside of the swf rather than load it externally.
I tried a #include but found that it only works for actionscript. Perhaps there is a similar command that could include an xml for compile?
- dijitaq0
yes you can write the xml within the actionscript.
var other_xml:XML = new XML("
San Francisco");
- dijitaq0
go to the flash help (F1)
btw, how do you write codes here??
- Chadwick0
Do you know if it's possible to embed or compile into the swf an entire xml document?
- Chadwick0
Not sure how to write code, I don't believe they have tags for it. People usually use something like pastebin.
- fusionpixel0
you can write the code to trace the code as you need it in flash and, copy and paste into a new doc
- Chadwick0
fusionpixel, could you explain that method in more detail please? I don't understand.
- Chadwick0
thanks diji, that might help. Do you know if it's possible to import a whole external XML doc like that?
Something like:
var myXML:XML = new XML("my_xml_doc.xml");
?
- fusionpixel0
to have a whole xml in your SWF you need to add it manually. so what i was suggesting is that instead of writing your code to write the proper AS for the XML just write a loop that would output the XML the way you want it.
Once you have it the way you need it in the output panel, select all, copy and paste it into your FLA and you should be ready to go, all within the SWF without having to rely on external XMLs
- dijitaq0
no can do. you have to parse the xml.
havent tried it myslef, but you could write your xml onto an as file then #include that in your actionscript.
or parse your xml on the as file. but havent tried this either. sorry.
- Chadwick0
Thank you both for your input, I was thinking the same thing about creating a .as which essentially would weave an xml object from an external xml. It looks like I will have to write an as that parses an external XML into internal XML objects and then #include that as in the main swf.