Hello,
the answer to my question would probably not change my workflow, but I
want to know this:
When using the attachMovie method, it is possible to set values of
member variables. These values are set before the constructor is
executed.
Why that?
And furthermore:
Even private member variables can set this way and even the
constructor can be private. And why that?
Is there a special explanation or something obvious I missed?
For example:
initObject:Object = {_x: 20, _myPrivateVar: "Hello World!"};
this.attachMovie(MyExample.SymbolName, "myExample",
this.getNextHighestDepth(), initObject);
class MyExample extends MovieClip
{
public static var SymbolName:String =
"__Packages.com.relounge.cme.MyExample";
public static var SymbolOwner:Function = MyExample;
public static var SymbolLinked =
Object.registerClass(SymbolName,SymbolOwner);
private var _myPrivateVar:String;
private function MyExample()
{
trace(this._myPrivateVar); // traces the "Hello World!"
}
}
Thank you,
Matthias
_______________________________________________
[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