I am writing a class in Main.as that makes a urlRequest and returns the result. There are 3 nodes I need, minTemp, maxTemp and Icon. I'm making the request for one city so there should be just one occurrence of these nodes. How would I structure the AS3 to grab these nodes and their values?
public class Main extends MovieClip {
public function Main() {
var urlRequest:URLRequest=new URLRequest("http://myurl");
var urlLoader:URLLoader=new URLLoader();
var result:XmlDocument=new XMLDocument();
urlLoader.addEventListener(Event.COMPLETE, parseXML);
urlLoader.load(urlRequest);
result.ignorWhite=true;
result.parseXML(getXMLString());
}
}
I'm getting errors 1046 XmlDocument type was not found, 1120 access of undefined property parseXML, and 1180 call to possibly undefined method getXMLString. How would I clear those up as well?