Hi All,
I'd like to provide a String value which represents the DisplayObject
class I want to create dynamically with addChild. Has anyone
accomplished this?
This would be equivalent to createChild(findClass(Button)) in AS2...
Thanks,
Brendan
--
Flexcoders Mailing List
FAQ:
Hi All,
I'd like to provide a String value which represents the DisplayObject
class I want to create dynamically with addChild. Has anyone
accomplished this?
You mean like this?
public function createInstance (className : String) : Object {
var MyClass : Class =
PROTECTED] On
Behalf Of Brendan Meutzner
Sent: Wednesday, January 18, 2006 9:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] addChild from String
Hi All,
I'd like to provide a String value which represents the DisplayObject
class I want to create dynamically with addChild. Has anyone
);
return inst;
}
Matt
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jens Halm
Sent: Wednesday, January 18, 2006 10:32 AM
To: Brendan Meutzner
Subject: Re: [flexcoders] addChild from String
Hi All,
I'd like to provide a String value which
public function createInstance (className:String, args:Array) : Object {
var myClass : Class = getClassByName(className);
var inst : Object = new myClass();
inst.initArgs.apply(inst, args);
return inst;
}
Yes, that would be a workaround if I have complete control over the
5 matches
Mail list logo