AS3:错误#1006:值不是一个函数 [英] AS3: Error #1006: value is not a function

查看:982
本文介绍了AS3:错误#1006:值不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了一张code:

 跟踪((数组[0] [0]));
跟踪((数组[0] [0]日期));
跟踪((数组[0] [0]为日期)。时间());
 

这是我的输出:

 周五8月9日12点10分零零秒GMT + 0200 2013
真正
类型错误:错误#1006:值不是一个函数。
    ...
 

我很困惑。我该如何解决这个问题?

//编辑:的 哦,应该是

 跟踪((数组[0] [0]作为日)。时​​间);
 

解决方案

 跟踪((数组[0] [0]作为日).getTime());
 

 跟踪((数组[0] [0]作为日)。时​​间);
 

该错误说,时间是不是类Date功能 - 它不是,它是一个属性。但有一个功能的getTime()这可能是你所追求的。

Date类手动

I got piece of code:

trace((array[0][0]));
trace((array[0][0] is Date));
trace((array[0][0] as Date).time());

and this is my output:

Fri Aug 9 12:10:00 GMT+0200 2013
true
TypeError: Error #1006: value is not a function.
    ...

I'm confused. How can I fix this?

//edit: Oh, it should be

trace((array[0][0] as Date).time);

解决方案

trace((array[0][0] as Date).getTime());

OR

trace((array[0][0] as Date).time);

The error says that "time" is not a function of class Date - it is not, it's a property. But there is a function getTime() which might be what you seek.

Date class manual

这篇关于AS3:错误#1006:值不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆