I repeat: the recommended practice is to use a custom itemRenderer.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Freiman Sent: Monday, October 22, 2007 11:13 AM To: [email protected] Subject: Re: [flexcoders] Dynamic class creation? Fill ClassFactory work? http://livedocs.adobe.com/flex/201/langref/mx/core/ClassFactory.html <http://livedocs.adobe.com/flex/201/langref/mx/core/ClassFactory.html> - Dan Freiman On 10/22/07, Ian Thomas <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Hi Christophe, Unfortunately not, but thanks. To explain, I'll copy a response email that I just posted to Flash_tiger: ----- I know of getDefinitionByName, but that won't work for me as I'm not returning back different class definitions - I'm returning the _same_ class definition each time, but want to parameterise it. As to why I'm doing this / what I'm hoping to achieve... I'm writing a framework that integrates with the Flex components but which is agnostic about where its assets come from. I have (for example) a BitmapData object - never mind how I got it - and want to be able to transform it into a BitmapAsset class to pass to (say) a TileList. To do that I need to be able to pass a Class rather than an instance - a descendant of BitmapAsset. I can't pass new BitmapAsset(bitmapData), because that's an instance, not a class. I can't pass just BitmapAsset, because it doesn't have the relevant bitmapData and has no way of getting it. I need to pass some sort of dynamic class or class function which can have new X() called on it and is parameterised with the appropriate bitmapData. Does that make any sense? ---- Thanks, Ian On 10/22/07, Christophe Herreman < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Hi Ian, maybe this will solve your problem (if I understood correctly): var clazz:Class = getDefinitionByName("com.domain.MyClass") as Class; http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html#getDef initionByName() <http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html#getDe finitionByName%28%29> regards, Christophe

