Flex - 为什么在我的 Date 对象上找不到这些方法?

发布于 2024-12-27 11:29:07 字数 468 浏览 0 评论 0原文

我正在尝试编译一些示例动作脚本代码。在 Flex (Flash Builder 4.6) 中,我导入了一个项目文件夹(恰好是 PurePDF 示例)。

在一些地方,我有黄色的“?”查看源文件时的图标 - 尽管还没有显示任何警告或错误(我确实有其他错误正在解决)。

这是一个例子 - 当我将鼠标悬停在“?”上时图标,我看到未定义属性 getTime 的访问:

end_time = new Date().getTime();

另一种说法是未定义的属性 getStackTrace()

catch ( e: Error ) { 跟踪( e.getStackTrace() ); 我

清理了我提到的错误,以及这些黄色的“?”查看代码时标记仍然出现。 “问题”窗口中没有警告或错误,但我描述的这些问号仍然存在。即使我关闭文件并清理项目并重新打开文件。

I am trying to compile some example actionscript code. In Flex (Flash Builder 4.6) I imported a project folder (happens to be the PurePDF examples).

In a few places, I have yellow "?" icons when looking at the source files - though there are no warnings or errors showing up for them yet (I do have other errors I am addressing).

This is an example - when I hover the "?" icon, I see access of undefined property getTime:

end_time = new Date().getTime();

Another one, says undefined property getStackTrace()

catch ( e: Error )
{
trace( e.getStackTrace() );
}

I cleaned up the errors I mentioned, and these yellow "?" marks still appear when viewing the code. There are no warnings or errors in the 'problems' window, but these question marks I describe are still there. Even if I close the file and clean the project and re-open the file.

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

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

发布评论

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

评论(2

卸妝后依然美 2025-01-03 11:29:07

这与 Falsh Builder 存在问题。无论如何,要克服它,请使用:

new Date().time

而不是

new Date().getTime()

It seams an issue with Falsh Builder. Anyway to get over it use:

new Date().time

instead of

new Date().getTime()
如若梦似彩虹 2025-01-03 11:29:07

getTime() 是 Date 类的方法;
getStackTrace() 是 Error 类的方法。

确保您已导入这两个顶级类:

import Error
import Date

getTime() is a method of the Date class;
getStackTrace() is a method of the Error class.

Make sure you have imported these two top classes:

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