Reputation: 21
With XML I read some content into my .swf (like images, text... ). Everything workes fine, as long as this .swf is in the same File. When I change the File the dynamic content is lost. I know that this is because the XML cannot be read anymore (and the file of the images change... ). But since I want to upload this swf, and only one file is allowed at the upload, I need to include this into my swf. How can I do that?
Upvotes: 0
Views: 92
Reputation: 39458
If you want to include the XML directly into your ActionScript, it's just a matter of copy and paste:
var xml:XML = your_xml_here;
It can be pasted across multiple lines without any problems.
As for the images, they'll need to be included in the SWF as well if you need it all to be self-contained (either via a SWC or by directly importing them into the FLA's library). I suspect this isn't going to be very good because if you have many images, the SWF is going to be very large and have a long load time.
The other issue with this is that you're going to need to:
getDefinitionByName()
that uses the class names to create an instance of the relevant image in your library.If you have the capability to upload all of the images and XML elsewhere, you can retain your current setup with a simple change to the XML, by reference the full path of the images online.
Upvotes: 1