That's too bad--with classes as first-class objects, it's pretty sexy to
be able to do something like
var someClass:Class = getDefinitionByName("com.truviso.SomeClass");
var someObj:ISomeInterface = new someClass();
...
instead of having to lather on the syntax like in Java. It'd be nice to
do more stuff along those lines. Thanks anyway, Alex.
--
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com
-----Original Message-----
From: Alex Harui <[email protected]>
Reply-To: [email protected]
To: [email protected] <[email protected]>
Subject: RE: [flexcoders] runtime class type reference?
Date: Thu, 11 Dec 2008 15:18:09 -0800
There isn’t much introspection APIs in AS. I’d use
getQualifiedClassName instead of getClassInfo. getClassInfo can be
expensive
From: [email protected] [mailto:[email protected]] On
Behalf Of Maciek Sakrejda
Sent: Thursday, December 11, 2008 3:03 PM
To: flexcoders
Subject: [flexcoders] runtime class type reference?
Is there a way to get a reference to the runtime type of an AS3 object?
Something like Foo.class in Java? I think I can do
var mysteryObjClass:Class =
getDefinitionByName(getClassInfo(mysteryObj).name);
but this strikes me as a rather roundabout way of doing it.
--
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com