Flex - 为什么在我的 Date 对象上找不到这些方法?
我正在尝试编译一些示例动作脚本代码。在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这与 Falsh Builder 存在问题。无论如何,要克服它,请使用:
而不是
It seams an issue with Falsh Builder. Anyway to get over it use:
instead of
getTime() 是 Date 类的方法;
getStackTrace() 是 Error 类的方法。
确保您已导入这两个顶级类:
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: