(mx.core.UITextField 是 flash.text.TextField)返回 false。这怎么可能?

发布于 2024-08-21 07:14:45 字数 250 浏览 9 评论 0原文

我正在 FlashDevelop 下的仅 AS 项目中遍历使用 flash.display.Loader 加载的 SWF 的子级。

对对象调用 flash.utils.getQualifiedClassName(obj) 将返回“mx.core::UITextField”,虽然它是 flash.text.TextField 的子类,但调用 (obj is flash.text.TextField) 返回 false。

对此有何见解? 我做错了什么吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一袭白衣梦中忆 2024-08-28 07:14:45

您正在使用 flash.utils.getQualifiedClassName(obj) 询问类名称。 UITextField 类扩展了 flash.text.TextField 类。因此该类是 UITextField 而不是 TextField。

这样想

class TextField
{ 
}

class UITextField extends TextField
{
}

你需要使用 getQualifiedSuperclassName() 来获取 TextField

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

苦行僧 2024-08-28 07:14:45

看来,问题(像往常一样)出在我自己的代码上,而不是 IS 运算符。
下次我会更加小心,并在发布之前仔细检查我的代码。
很抱歉发送垃圾邮件...

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文