I was looking into this, because I wanted to do some IoC work in Flex.
 I found one issue, I don't have any reference for getClassByName adn
cannot compile when trying to use it.  Was it removed?  what's the
deal there?

Anyway, one solution I had thought of was to use a ObjectFactory of
sorts.  Then you pass in an array of arguments to a getInstance
function and it would use the correct call based on the length of the
array.  It would be more code but it would be hidden away in a factory
class.  If you need an example let me know.

Paul
--- In flexcoders@yahoogroups.com, "herrodius" <[EMAIL PROTECTED]> wrote:
>
> Hi guys,
> 
> I'm looking for a way to dynamically invoke a constructor and pass in
> arguments. I know this was possible in AS2 with
> Function.apply() on the constructor property of an object but I didn't
> find anything in AS3.
> 
> I found a 1-year old post from Matt Chotin that says it wouldn't be
> possible in AS3, but I was kinda hoping it might have magically
> changed by now ;-)
> http://www.mail-archive.com/flexcoders@yahoogroups.com/msg21919.html
> 
> Any tips?
> 
> thx,
> Christophe
>


Reply via email to