There are other cool utils around that do introspection, but here's mine: http://is.gd/7iTx
-Josh On Fri, Dec 12, 2008 at 9:30 AM, Maciek Sakrejda <[email protected]>wrote: > 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 > > > > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [email protected] :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk

