// Author: Robert Lie (Mobilefish.com) // More information, see: https://www.mobilefish.com/developer/flash/flash_quickguide_actionscript_3_examples.html var xmlFile:String = "sample_file2.xml"; function loadHandler():void { var urlRequest:URLRequest = new URLRequest(xmlFile); var urlLoader:URLLoader = new URLLoader(); urlLoader.addEventListener(Event.COMPLETE, callServerHandler); urlLoader.load(urlRequest); } function callServerHandler(e:Event):void { var xml:XML = new XML(e.target.data); // Loop through all items and only show scifi movies for each(var item in xml..movie) { if(String(item..category) == "scifi") { trace("Title: " + item.title); trace("Price: " + item.price); trace("-----------------------"); } } } loadHandler();