So I want to include XML files in my SWF as level data files.
Here's where I'm embedding the file:
package
{
public class Levels
{
[Embed(source = '../../../../assets/levels/test.xml')]
public static const Level_Test:Class;
}
}
And here's where I'm trying to use it:
var xml:XML;
var file:Class;
file = new Levels.Level_Test();
xml = file;
...parse the XML...
Obviously I have no clue what I'm doing. I also tried using "xml = file.data;" to no avail. How do I translate file to an XML object?
The weird part is that I'm getting syntax errors from the XML file when I try to compile this
Error: Syntax error: expecting semicolon before xmltagstartend.
<WIDTH>30</WIDTH>
(No, the XML file is not in my source folder - it is in my assets folder so it shouldn't be trying to compile it that I know of)