Hi, all;

I have a component that was working last week, but on Friday I had a 
crash that meant my machine would not reboot, so I had to restore 
from the Windows Home Server backup.  I thought my machine was back 
100% from where it was, but I tried to run some Flex code that worked 
last week and it is not working at all today.

The intent of the component is to read in an external xml file and 
make it available as a data source in mxml.

package magnoliamultimedia



{
        import flash.events.Event;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        
        import mx.collections.XMLListCollection;
        
        [Bindable]
        [DefaultProperty("xmlData")]
        public class XMLLoader extends URLLoader
        {
                private var _request:URLRequest;
                private var _path:String;
                private var _xmlData:XMLListCollection;
                
                public function XMLLoader(request:URLRequest=null)
                {
                        super(request);
                }
                public function get path():String{
                        return _path;
                }
                public function set path(path:String):void{
                        _path = path;
                        _request = new URLRequest(_path);
                        this.addEventListener(Event.COMPLETE, 
getURLResult, false, 0, true);
                        this.load(_request);
                }
                public function get xmlData():XMLListCollection{
                        return _xmlData;                        
                }
                private function getURLResult(e:Event):void{
                        var resultXML:XML = XML(this.data);
                        if (!_xmlData) {
                                _xmlData = new XMLListCollection
(resultXML.children());
                        } else {
                                _xmlData.source = resultXML.children
();
                        }
                        this.removeEventListener(Event.COMPLETE, 
getURLResult);
                }
        }
}

Am I totally stoned in my recollection that this worked last week?  
When the complete event fires, the data property is empty.  I've 
tried passing in a path of data/data.xml and moving the xml file to 
the root and just using data.xml.

If anyone has any ideas, I'd greatly appreciate it.

Thanks;

Amy

Reply via email to