Hi list,

I'm working on a new version of my reflection package and saw that my class
check ( obj instanceof Function && obj.constructor != null) isnt as
foolproof as I thought :). For example this doesnt work for built in classes
such as Stage.

I tried a lot of different solutions, even looked in other reflection
packages such as PixLib, but they suffer from the same problem.

It's not that big of a deal, since these classes that dont comply are
usually static only classes and not passed around to loggers etc anyway, but
its.. well ... pretty darn annoying !

I'm looking for a simple check isClass(obj:Object):Boolean that works:)

All the cases I came up with worked for some objects and not for others:
testcase:
isClass(_global.mx) => should be false
isClass(_global.flash) => should be false
isClass(Stage) => should be true
isClass(MovieClip) => should be true
isClass(_global.trace) => should be false.

Anyone up to a puzzle?:)

greetz
JC

ps a simple solution is just to put in a check for Stage, Mouse, etc but I'm
trying to find a solution without such 'hacks'
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to