三种特殊类型是无类型说明符 (*)、void 和 Null。
| 类型 | 说明 | |
|---|---|---|
| * | 指定属性是无类型的。 | |
| void | 指定函数无法返回任何值。 | |
| Null | 一种表示没有值的特殊数据类型。 |
| * | 特殊类型 |
propertyName:*| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
指定属性是无类型的。使用星号作为类型注释与不使用类型注释等效。从无类型属性中读取的表达式可视为无类型表达式。建议在以下情况下使用无类型表达式或属性:
undefined 存储于属性中。与 ActionScript 的早期版本不同,值 undefined 不是 Object 数据类型的成员。必须使用无类型属性来存储值 undefined。另请参见
| void | 特殊类型 |
functionName():void {}| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
指定函数无法返回任何值。void 类型是一个特殊类型,它仅包含一个值:undefined。此类型的特殊之处在于其仅用于函数的返回类型。不能将 void 用作属性的类型注释。
另请参见
| Null | 特殊类型 |
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
一种表示没有值的特殊数据类型。Null 数据类型仅包含一个值:null。Null 数据类型的特殊之处在于此类型不与类相关联。这意味着不可将 Null 数据类型用作属性的类型注释。
另请参见
当前页: http://livedocs.adobe.com/flash/9.0_cn/ActionScriptLangRefV3/specialTypes.html