----- Original Message ----- From: "Muzak" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Sunday, July 08, 2007 4:47 PM
Subject: Re: [Flashcoders] XML loading and parsing problem


erhmm..

Then show me how you use 'this' inside an xml onload handler to invoke a method outside the handler.
Or better yet, prove me this:

<quote>
If the xml is all setup on the main timeline, then 'this' is the same in both cases
</quote>

regards,
Muzak

OK, my comment about 'this' isn't completely right, but I am certainly right about the use of Delegate for the XML loader.

If you don't use the Delegate class and try and access the attributes of a class within an onLoad function, you won't have access to the class atrributes, so you must use a delegate. If you don't use the Delegate class on the main timeline and try and access the variables declared on the timeline you will be able to access them, so you don't have to use a delegate.

Stick the following code onto the timeline and see how you get on..

Paul

stop();
var thisVariable:String="This is me";
trace(this.thisVariable);
var test:XML = new XML();
test.ignoreWhite = true;
test.onLoad = function(success) {
   if (success) {
       trace("loaded");
 trace(thisVariable);
 trace(this.thisVariable);
   }
};
test.load("test.xml");

/*

test.xml:

<test>
<something />
</test>

*/

_______________________________________________
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