Hi there,
I’m creating a flash project and would like to pilot the most variables (eg: colors, texts, sizes, …) from a single XML file and then spread them in my document class.
Could you tell me how to mod this ?
public var yourName:String;
public var myXMLLoader:URLLoader = new URLLoader();
public function intro():void {
myXMLLoader.load(new URLRequest("xml/config.xml"));
myXMLLoader.addEventListener(Event.COMPLETE, processXML);
}
public function processXML(e:Event):void {
var myXML:XML = new XML(e.target.data);
yourName = myXML.@webName;
trace (yourName); // doesnt return anything
myXMLLoader.removeEventListener(Event.COMPLETE, processXML);
myXMLLoader = null;
}
That’s how my xml is coded :
<?xml version="1.0" encoding="utf-8"?>
<webName>
<![CDATA[My name...]]>
</webName>
Right now I got no errors but I got nothing when tracing the “yourName” var.
I must be missing something,
Thank you sincerly,