--- In [email protected], "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> > i'm able to add a new class on the fly
> 
>  
> 
> No, you're not adding a new class on the fly. You're creating a new
> instance of a ClassFactory subclass on the fly. A class is something
> that is defined at compile time by a class { .. } definition. You 
cannot
> create new classes at runtime, only instances of them.

It seems to me, though, that once you have that instance, it would be 
really cool if you could add stuff to it on the fly and then use that 
to stamp out new objects.  After all, now you can do something like 
this:

//create new INSTANCE of Canvas
myCanvas:Canvas = new Canvas();
myButton:Button = new Button();
myButton.label = 'test';
myCanvas.addChild(myButton);

If you could then take that Canvas and use it for an itemRenderer, 
how cool would that be?  So if ClassFactory had some mechanism to 
call the methods that the object _in_ the factory has, we could not 
only use it for itemRenderers, but there would be a more satisfying 
answer for people who get frustrated trying to assign the same object 
to multiple parents.

-Amy

Reply via email to