On 4/7/06, Rifled Cloaca <[EMAIL PROTECTED]> wrote:
All,
Is there a way to get the instance name of a class from within the
class? I need to refer to a variable by its absolute targetPath, but
the instance name of the class is not known until runtime.
class Foo {
var results:String;
var resultVar:String;
function foo () {
this.resultVar = "_level0." + instanceName? + ".results";
}
}
// example
myFoo = new Foo();
myFoo[resultVar] = "Bar";
How can I get instanceName? Thanks!
If your class inherits from MovieClip you get _name for free.
class Ball extends MovieClip {
functuon ident():String {
return "[Ball] at " + _name;
}
}
_______________________________________________
[email protected]
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