I'm not sure all classes are "in the appdomain " at startup.  They are
in the SWF, but I'm not clear getDefinition will find it if other code
hasn't used that class yet.  It is at minimum, a string to hashcode
lookup.  All such things like Reflection also make the player larger and
sometimes make the vm slower so lots of reflection was left out to buy
speed given that it isn't frequently used and can be coded up some other
way.

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Troy Gilbert
Sent: Tuesday, August 26, 2008 4:11 PM
To: [email protected]
Subject: Re: [flexcoders] Get all class definitions in a loaded swf ?

 

> I think it will always be more efficient to do the legwork and put
> descriptions in the SWFs. Introspection/Reflection APIs generally
aren't
> fast.

Reflection APIs generally aren't fast because they're written in the
same language (or run in the same machine, virtual or otherwise) as
the code they're reflecting on. For a *virtual* machine, the host
(i.e. Flash Player) already has to do the minimum reflection work of
getting class names from the SWF before your bytecode is even
executed...

Troy.

 

Reply via email to