var xml:XML = flash.utils.describeType(this);
这里的this 可以换成其他的对象 什么button canvas 自己定义的类 自己去尝试
for example
package
{
public class testClass
{
private var _className:String;
public function get className():String{
return _className;
}
public function set className(value:String):void{
_className = value;
}
}
}
var obj:testClass = new testClass();
var xml:XML = flash.utils.describeType(obj);
trace(xml.toXMLString());
输出结果
<type name="textClass" base="Object" isDynamic="false" isFinal="false" isStatic="false">
<extendsClass type="Object"/>
<accessor name="className" access="readwrite" type="String" declaredBy="textClass"/>
</type>
这里的this 可以换成其他的对象 什么button canvas 自己定义的类 自己去尝试
for example
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
输出结果
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)