You can not do complex assignments like that outside of a function.  Because of 
the way the swf is compiled, the declared vars do not exist when you are 
attempting to initialize them.

 

Declare the vars like you have, in the instance scope, but then create an 
init() function and call it from the initialize of creationComplete event.  Do 
the initialize assignments in that function.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of David 
Pariente
Sent: Monday, August 25, 2008 3:39 PM
To: flexcoders
Subject: [flexcoders] problem with a simple XML Loader :(

 

Hi all, 

I'm making a very simple XML Loader on AS3 and i get an error...i saw more than 
3 examples and checked it all again and again and still don't know what's wrong.

the code: (inside an mx:script)

                    import flash.events.Event;
                    import flash.net.URLLoader;
                    import flash.net.URLRequest;

                    var rXML:XML = new XML();
                                        
                    var rXMLURL:URLRequest = new URLRequest("rhoytod.xml");
                    var rLoader:URLLoader = new URLLoader(rXMLURL);
                            
                    rLoader.addEventListener(Event.COMPLETE, rLoaded); 
                                                            
                    private function rLoaded(event:ResultEvent) : void{
                   }

the error (on the addEventListener line):

1120: access to a nondefined property rLoaded
1120: access to a nondefined property rLoader

it might be a basic mistake...as all this is quite simple, don't know what's 
wrong.

thnx a lot for the help


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.es 

 

Reply via email to