PDA

View Full Version : xml - what to do in actionscript 3.0


felisan
10-01-2007, 09:14 PM
hello everyone.


i've tried to test a simple use of xml in actionscript 3.0.
for this purpose, I've created this very simple xml-file:

<?xml version='1.0' encoding='utf-8'?>
<bestyrelsen>
<bestyrelsesmedlem>Johannes Mikkelsen</bestyrelsesmedlem>
</bestyrelsen>


and then loaded it into flash using this:


import flash.display.*;
import flash.net.*;
import flash.events.*;
import flash.utils.*;
import flash.xml.*;
import flash.errors.*;
var myXML:XML;
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, onComplete);
urlLoader.load(new URLRequest("bestyrelsen.xml"));

function onComplete(e:Event){
myXML = new XML(urlLoader.data);
trace("here I want the name from the xml traced: "+urlLoader.data);
}



all I need to do is to know how to trace the name Johannes Mikkelsen from the xml.. can anyone help me?


thanks
felisan

felisan
10-02-2007, 07:51 PM
please, can anyone help me with this simple subject?

hipjimmer
10-03-2007, 09:57 PM
You'll find this article very helpful.

http://www.actionscript.org/resources/articles/9/1/XML-101/Page1.html