[mtasc] Loading xml

Mark Winterhalder mark13 at gmail.com
Thu Jun 30 00:20:26 CEST 2005


hi Aaron,

this line:
>     private var XML_Region : XML;
only tells the compiler to expect XML_Region to have an XML object
assigned later, and to complain if it's of some other kind. it does
not create an XML object.

to fix it, after:
>     function test() {
add:
   XML_Region = new XML();

also, it is good practice to capitalise your class names and
constructor functions:

class Test {
   ...
   public function Test () {
      ...

hth,
mark



On 6/29/05, Aaron Spjut <me at aaronspjut.com> wrote:
> 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
> 
> 


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



More information about the mtasc mailing list