>><<You just have to make sure everything you need is preloaded before
you start running>>

>>How would I do that?

package utils 
{
        import events.XMLFileLoaderEvent;
        import flash.events.Event;
        import flash.events.EventDispatcher;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        
        public class XMLFileLoader extends EventDispatcher
        {
                public var xml:XML;
                
                private var _xmlURL:String;
                private var _urlLoader:URLLoader;
                
                public function XMLFileLoader(xmlURL:String) 
                {
                        _xmlURL = xmlURL;
                        _urlLoader = new URLLoader(new
URLRequest(_xmlURL));
                        _urlLoader.addEventListener(Event.COMPLETE,
onXMLLoaded); 
                }
                
                private function onXMLLoaded(event:Event):void
                {
                        xml = new XML(event.target.data);
                        dispatchEvent(new
XMLFileLoaderEvent(XMLFileLoaderEvent.LOAD_COMPLETE));
                }
                
        }
        
}

In addition to the complete event, I would assume you can listen to the
progress events of URLLoader to get bytesloaded and bytestotal as well,
though I have never bothered with it for XML myself.


Jason Merrill 

Bank of  America  Global Learning 
Learning & Performance Solutions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to