Hi,

hmm okay I give up, I'm just sticking with my previous implementation, and
will add some special cases.
Currently the result is:

Running process: C:\Program Files\FlashDevelop\tools\fdbuild\fdbuild.exe
"D:\checkout_flash_library\sources\framework\examples\nl.trimm.reflect\ReflectionExample.fdp"
-cp ""

Building ReflectionExample

  1. getStyleCounter is property
  2. __SVMouseWheelManager is object
  3. org is object
  4. origHeight is property
  5. origWidth is property
  6. skinRegistry is object
  7. styles is object
  8. cascadingStyles is property
  9. style is object
  10. mx is object
  11. ReflectionExample is class
  12. nl is object
  13. TextSnapshot is class
  14. PrintJob is class
  15. MovieClipLoader is class
  16. textRenderer is class
  17. flash is object
  18. System is object
  19. Accessibility is object
  20. Video is class
  21. Stage is object
  22. TextFormat is class
  23. TextField is class
  24. Button is class
  25. Key is object
  26. Mouse is object
  27. Selection is object
  28. LoadVars is class
  29. XML is class
  30. XMLNode is class
  31. Sound is class
  32. Math is object
  33. Array is class
  34. String is class
  35. Date is class
  36. Boolean is class
  37. Number is class
  38. o is property
  39. showRedrawRegions is property
  40. setTimeout is function
  41. clearInterval is function
  42. clearTimeout is function
  43. setInterval is function
  44. isFinite is function
  45. isNaN is function
  46. updateAfterEvent is function
  47. trace is function
  48. parseFloat is function
  49. parseInt is function
  50. unescape is function
  51. escape is function
  52. ASSetNativeAccessor is function
  53. ASSetNative is function
  54. ASSetPropFlags is function
  55. RemoteLSOUsage is class
  56. AsSetupError is class
  57. Error is class
  58. ContextMenu is class
  59. ContextMenuItem is class
  60. LocalConnection is class
  61. SharedObject is class
  62. Microphone is class
  63. Camera is class
  64. NetStream is class
  65. NetConnection is class
  66. Color is class
  67. AsBroadcaster is class
  68. XMLSocket is class
  69. MovieClip is class
  70. Infinity is property
  71. NaN is property
  72. Function is class
  73. Object is class
  74. ASconstructor is property
  75. ASnative is property

Not entirely correct but adding Stage, Mouse etc as a special case and
filtering out _global properties that start with a lowercase character will
do the trick :).

If anyone is interested I'll post the new package when it's done. The old
package (that I've been using in xflash) was ok too, but somewhat limited
and it did not refresh it's class cache after an swf was loaded.

greetz
JC


On 7/3/07, Hans Wichman <[EMAIL PROTECTED]> wrote:

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'

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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