There a re a few scope related issues that every developer stumbles across once 
they start writing their own classes.

The first is accessing the class scope from within a xml object , solved by 
defining a local variable withing the constructor before your XML object.

var parent:ClassName= this;
_xmlData.onLoad = function(success:Boolean) {                   
                if(success) {
      parent.[class imethods you want to reference here]
}

Another is accessing the container clip for a class if created at runtime 
solved by simply passing a reference to the container as an argument in the 
constructor

ie
private var owner:MovieClip
public function MyClass(createdBy:MovieClip) {

owner=createdBy


But one issue that sometimes puzzles me is how to accurately reference the 
class anywhere in a class.
If you are sub-classing a Movieclip, then technically speaking, using 'this' 
references the MovieClip, not the class, am I correct?



[e] jbach at bitstream.ca
[c] 416.668.0034
[w] www.bitstream.ca
--------------------------------------------
"...all improvisation is life in search of a style."
             - Bruce Mau,'LifeStyle'
_______________________________________________
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