[flexcoders] Any way to cast a string reference of a class name to its Class equivallent

2007-12-19 Thread polestar11
Hi there I have a list of class names stored as strings in an xml file. Is there any way to cast them to actual class items programatically once the file has loaded. Eg. item classname=aClass/ // in code myComponent.setStyle(icon, Class([EMAIL PROTECTED])); Cheers Tracy

RE: [flexcoders] Any way to cast a string reference of a class name to its Class equivallent

2007-12-19 Thread Alex Harui
getDefinition From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of polestar11 Sent: Wednesday, December 19, 2007 4:05 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Any way to cast a string reference of a class name to its Class

RE: [flexcoders] Any way to cast a string reference of a class name to its Class equivallent

2007-12-19 Thread Gordon Smith
There is a getDefinitionByName() function (not method) in the flash.utils package which will give you a Class reference if you give it a fully qualified class name like mx.controls.Button. However, if the class doesn't actually exist in your application or in the Player, it will return null. So