[mtasc] Loading xml

Mark Winterhalder mark13 at gmail.com
Thu Jun 30 00:53:47 CEST 2005


>     static function main() {
>         var t = new test();
>     }

i can imagine the garbage collector having your instance of "test"
deleted by the time it has finished loading.
try assigning it to a static property.

hth,
mark


On 6/30/05, Aaron Spjut <me at aaronspjut.com> wrote:
> Sorry I  hadn't copy and pasted everything the first time. 
> 
> Even with the instantiation this doesn't work:
> 
> class test{
>     private var XML_Region : XML;
>     function test() {
> 
>     
>         XML_Region = new XML();
>         XML_Region.ignoreWhite = true;
> 
>         XML_Region.onLoad = function(success){
>             TRACE(success);
>         };
>         XML_Region.load("a file");
>     }
> 
>     static function main() {
>         var t = new test();
>     }
> }
> 
> 
> Aaron
> 
> 
> 
> 
> On Jun 29, 2005, at 3:12 PM, JesterXL wrote:
>  
> Close; you need to instantiate it as an XML class; just defining it up top
> won't work. 
>   
> Add this at the top of your test function: 
>   
> XML_Region = new XML(); 
>   
> ----- Original Message ----- 
> From: Aaron Spjut 
> To: MotionTwin ActionScript2 Compiler List 
> Sent: Wednesday, June 29, 2005 5:52 PM 
> Subject: [mtasc] Loading xml 
> 
> Sorry if this has been posted but I couldn't  find an answer. 
> 
>  
> This is what I'm trying to do: 
> class test{ 
>     private var XML_Region : XML; 
>     function test() {
>     
>  
>         XML_Region.ignoreWhite = true; 
> 
>  
>         XML_Region.onLoad = function(success){ 
>             TRACE(success); 
>         }; 
>         XML_Region.load("a file"); 
>     } 
> 
>  
>     static function main() { 
>         var t = new test(); 
>     } 
> } 
> 
>  
> The onLoad function doesn't seem to be getting called. 
> 
>  
> Is there a different/better way? 
> 
>  
> Thanks for any help. 
> 
>  
> Aaron 
> 
> 
> ________________________________
> 
> 
> --
> MTASC : no more coffee break while compiling
> --
> MTASC : no more coffee break while compiling 
>  
> --
> MTASC : no more coffee break while compiling
> 
> 


-- 
http://snafoo.org/
jabber: mark13 at jabber.org.uk



More information about the mtasc mailing list