I need to build an XML file that is read by this code.
I can't figure out how to do it.
public function formDoneLoading(param1:ServerConfig) : void
{
this.serverConfig = param1;
this.loadAvatars("boy");
this.loadAvatars("girl");
this.hairXMLLoader = new URLLoader(new
URLRequest(this.avatarPath + "defaultHair.xml"));
this.hairXMLLoader.addEventListener(Event.COMPLETE,this.hairXMLLoaded);
//this.hairXMLLoader.load(); //# this part is missing in original code
}
private function hairXMLLoaded(param1:Event) : void
{
var _loc2_:XML = XML(this.hairXMLLoader.data);
this.BOY_INIT_HAIR = _loc2_.defaultHair.@boy;
this.GIRL_INIT_HAIR = _loc2_.defaultHair.@girl;
}
Is what I'm doing right? This is how you write the XML document
My example XML: