Check out the LiveDocs for getDefinitionByName():

http://livedocs.adobe.com/flex/201/langref/flash/utils/package.html

Regards,
Dave.
Cynergy Systems

On 9/30/07, keith <[EMAIL PROTECTED]> wrote:
>
>   I want to convert something like the String "mx.controls.ComboBox" to a
> Class.
> I would use this to declare components or other classes at runtime.
> *Please don't laugh at me*
>
> //==============================
> //In areas where I CAN do this...
> //---------------------------------------------
> var testA:* = new mx.controls.ComboBox();
> addChild(testA);
> //==============================
>
> //=====================================
> //I want to DYNAMICALLY do the same...
> //--------------------------------------------------------
> var classname:Class = Class("mx.controls.ComboBox");
> var testB:* = new classname();
> addChild(testB);
> //=====================================
>
> //But get a this type of error---> TypeError: Error #1034: Type Coercion
> failed: cannot convert "mx.controls.ComboBox" to Class.
>
> -- Keith H --
>
>  
>

Reply via email to