1
votes

I am making a game with flash professional and action-script 3.0, that uses XML files for the levels. The code reads it and makes the level accordingly, every thing works fine, except when i publish to an external source, the code can no longer see the XML files. In flash pro cs6 is there any way to "attatch" the XML files to the published .swf so when it moves to another location, it can see them.

2

2 Answers

1
votes

Instead of using external XML files you could just create XML variables inside your game code. See the first two examples here about creating an XML object from an XML: Initializing XML variables

0
votes

Why don't you upload the xml on your own server and directly make requests there. For example your xml may be on http://yoursite.com/gameeditor/level1.xml. So, instead of using relative paths while loading the xml just use the remote http:// url.

Don't forget to add crossdomain.xml into your site, so you enable the cross-domain requests.