Loading XML into Flash...?
This is my xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<menu>
<food>
<name>Cheesesticks</name>
<price>3.00</price>
<class>Appetizer</class>
</food>
<food>
<name>Hot Wings</name>
<price>5.00</price>
<class>Appetizer</class>
</food>
<food>
<name>Hamburger</name>
<price>2.00</price>
<class>Entree</class>
</food>
<food>
<name>Cheeseburger</name>
<price>2.50</price>
<class>Entree</class>
</food>
<food>
<name>Ice Cream</name>
<price>4.00</price>
<class>Dessert</class>
</food>
</menu>
And this is my current ActionScript:
_root.file = new XML();
_root.file.ignoreWhite = true
_root.file.onLoad = function(){
}
_root.file.onLoad = function() {
no = this.firstChild.childNodes.length;
_root.menu = this.firstChild.childNodes[0]
>> I believe it goes here...whatever IT is. <<
}
_root.fileToLoad = "Menu.xml";
_root.file.load(_root.fileToLoad);
Does anyone know how to get the data and put it into my Lists?
http://img161.imageshack.us/img161/2139/asdfasdfqe6.png
|