This content has been marked as final. Show 5 replies
var content:Object = new Object();
var content:Array = new Array();
because you can't use push() on an Object.
Then you can trace with:
and you are just pushing every single attribute as an object in the array. Not very usefull.
To start you off:
To parse xml you might want to use XMLObject.as by Alessandro Crugnola (I've attached the class). Using that class you can create an object of your xml. I've written an example for you.
In the example I use LoadXML to load the xml file and then use XMLObject to create an object of the xml. In your xml I've wrapped the items in a data tag so you can add other nodes (like <config></config> that can contain information about your setup) to the xml. See the parsing routine in LoadXML where I use a switch to parse different nodes in the xml.
Once the xml has loaded and is parsed, the class broadcasts an event to subscribed objects - in the example the class SlideShow.as which is a wrapper class that instructs LoadXML to load the xml, receives the event and then starts loading the images (not implemented, it just traces a message at this point). The example should give you a good picture how you do this. Hope this helps.
Thank you very much my friend!
It traces nothing to me...
Ok sorry, my bad...
I didn't replaced my existing xml code with yours...
Now it works!