体验AS3.0(四)

      Flash 2006-2-14 13:37:00
我们已经知道,在包中可以直接定义函数。我迫切地想知道,在包中定义的函数到底是什么呢(也就是父类是什么)?一个新的函数:flash.util.describeType浮出了水面。这个函数可以以XML的形式返回这个对象所有的可用信息。
//TEST3.AS
package {
import flash.util.trace;
import flash.util.describeType;
import flash.display.MovieClip;

public var surname:String = "Mueller";

public function willi(){
trace("willi " + surname + " was here");

}

public class Test extends MovieClip {
public function Test() {
trace("Test " + describeType(willi));
}
}
}


我们会看到以下信息:
[SWF] C:\Documents and Settings\Administrator\My Documents\Flex\TEST2\bin\TEST2-debug.swf - 1,121 bytes after decompression
Test <type name="[[MethodClosure]]" base="Function" dynamic="false" final="true" static="false">

<accessor name="length" access="readwrite" type="int" declaredBy="[[MethodClosure]]"/>

<accessor name="prototype" access="readwrite" type="Object" declaredBy="Function"/>

<method name="toString" declaredBy="Function" returnType="String"/>

<method name="call" declaredBy="Function" returnType="Object">

<parameter index="1" type="Object" optional="true"/>

</method>

<method name="apply" declaredBy="Function" returnType="Object">

<parameter index="1" type="Object" optional="true"/>

<parameter index="2" type="Object" optional="true"/>

</method>

</type>
标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}
深度XP 雨林木风XP WinXP下载 世界之窗 深度系统 雨林木风 Ghost ghost系统盘 XP下载