I have this code: var myXML:XML = new XML(); var XML_URL:String = "http://gdata.youtube.com/feeds/api/videos?vq=football+-soccer&orderby=published&start-index=11&max-results=10"; var myXMLURL:URLRequest = new URLRequest(XML_URL); var myLoader:URLLoader = new URLLoader(myXMLURL); myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event:Event):void { myXML = XML(myLoader.data); trace("Data loaded."); } And I want to read the XML file into a XML object in Flex, so that I can access different elements of it easier. But it is throwing up two errors when I try to compile it: 1120: Access of undefined property myLoader. 1120: Access of undefined property xmlLoaded. What am I doing wrong? Do I need to import any special things first? I am still pretty new to Flex...