Hi Dane,

Here are some thoughts for you to try. First off since you are not actually working with a display object you don't need this class to extend sprite. The easiest way to give the class the ability to send out events is to have it extend EventDispatcher and then you can have it dispatch events as required... here is you sample pared down a bit, just dealing with xml

package {
        import flash.events.*;
        import flash.net.*;
        public class fileImports extends EventDispatcher {
                public var newStyleSheet:StyleSheet = new StyleSheet();
                public var newXML:XML = new XML();
                public function fileImports(xmlFile:String):void {
                        var xmlToLoad:URLRequest=new URLRequest(xmlFile);
                        var xmlLoader:URLLoader = new URLLoader;

                        xmlLoader.load(xmlToLoad);
                        //event listeners
                        xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);

                }

                public function xmlLoaded(event:Event):void {
                        newXML = XML(event.target.data);
                        dispatchEvent(new Event(Event.COMPLETE));
                }
        }
}

then in the movie calling the class

var tFile = new fileImports("data/xml/presenter1.xml");
tFile.addEventListener(Event.COMPLETE, xmlDone);
function xmlDone(e:Event){
        trace("done");
}

hth,

Rob

On Tue, 11 Sep 2007 15:25:05 -0400, Dane Williams <[EMAIL PROTECTED]> wrote:

My problem is I don't know how to "listen" to the class
from the main timeline to find out if the class is finished processing the XML. Right now if I try to use "fileForThis.newXML" I get a value of null. But if I put a trace on newXML in the class, it shows the content of my XML
file.
I have gotten this to work on other projects because I haven't tried to use
the data immediately - so the data has time to "process" before it's put
into a text field, etc.
I appreciate any help I can get on this. Thanks!
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to