Morten Barklund Shockwaved wrote:

Andreas Rønning wrote:

class ParseXML{ private var xmlDoc:XML; private function handleXML(){ trace(this); } function ParseXML(url:String){ xmlDoc = new XML(); xmlDoc.ignoreWhite = true; xmlDoc.onLoad = handleXML; xmlDoc.load(url); } }


It is amazing how we can turn back to this first-grade example of understanding scoping in ActionScript almost daily.

But I'll go with the flow and return the most common answer (that I also personally use):

class ParseXML{
   private var xmlDoc:XML;
   private function handleXML(){
       trace(this);
   }
   function ParseXML(url:String):Void {
       xmlDoc = new XML();
       xmlDoc.ignoreWhite = true;
       xmlDoc.onLoad = mx.utils.Delegate.create(this, handleXML);
       xmlDoc.load(url);
   }
   private function toString():String {
       return "i am not the xmlDoc";
   }
}

The issue is, that you have to make the xmlDoc call the handleXML-function with containing class as the activating scope. That can only be done via either hacking the XML-class or creating a special function, that will make the proper invocation of the proper function in the proper scope!

:)

*Yawn* here we go again, another new guy trying to understand this OBVIOUS concept that we've been through so many times already. I can't believe he's bothering us with this again! Thank you for the completely unnecessary derogatory tone. Obviously it goes without saying that you HAD to exhibit the most common of scandinavian traits: When the opportunity arises, belittle, then enlighten, because such an opportunity to come out "on top" cannot be missed under any circumstances, and emphasizing the apparent difference in experience between the master and pupil is first order . It is amazing how we can turn back to this first-grade example of lacking social skills almost daily.

Avoid the acute angle. There is no need whatsoever to adapt a belittling tone, and it rings particularly harsh on a pure text medium, which no amount of smiley action is going to alleviate.

- Andreas
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to