views:

95

answers:

2

I'm traversing the children of an SWF loaded using flash.display.Loader, in an AS-only project under FlashDevelop.

Calling flash.utils.getQualifiedClassName(obj) on the object returns "mx.core::UITextField" and while it is a subclass of flash.text.TextField, Calling (obj is flash.text.TextField) returns false.

Any insights on that? Am I doing something wrong?

A: 

You are asking for the Class Name with flash.utils.getQualifiedClassName(obj). The UITextField class extends the flash.text.TextField class. Thus the class is UITextField and not TextField.

Think of it this way

class TextField
{ 
}

class UITextField extends TextField
{
}

You need to use getQualifiedSuperclassName() to get TextField

Todd Moses
Excuse me for being rude, And thanks for your reply, but you're getting it all wrong...I don't need flash to tell me the superclass name, as you can tell from my question - I already know it.The problem is not with getQualifiedClassName - it is working fine.The problem is that (obj is flash.text.TextField) returns false.
Leeron
I must not understand. I thought you were checking to see if a UITextField was a TextField and that was returning False. My response was explaining that a UITextField is not a TextField but a UITextField and that is why it is returning false. If you check (obj is UITextField) that should return true.
Todd Moses
Anyway the `(obj is flash.text.TextField)` should also return true, the same way `anything is Object` should also return true. So it seems it is a weird problem...
LopSae
Yeah the weirdness is what got me to post in the first place, but as it appears I was mine and not flash's fault. Sorry for the hassle.
Leeron
A: 

Well as it appears, the problem was (as usual) with my own code and not the IS operator. Next time I'll try to be more careful and double check my code before posting. Sorry for spamming...

Leeron