[英]Is there a way to tell at runtime if a class is part of the Flex API or the Flash Player API?
在運行時是否可以確定類是Flex API的一部分還是Flash Player API的一部分?
例如,類“ flash.display.DisplayObject”是Flash API的一部分,而“ mx.core.FlexSprite”是Flex API的一部分。
我需要使用的只是類的名稱,即“ flash.display :: DisplayObject”或“ mx.core :: FlexSprite”。
根據我的理解,您需要獲取類名,您可以從Flash utils中獲取類名和超類名。
public static function getClassName(c:Class):String
{
trace("Class Name :: "+getQualifiedClassName(c)+" Super Class Name :: "+getQualifiedSuperclassName(c));
//trace("Describe Type"+describeType(c).toString());
var superClassName:String = getQualifiedSuperclassName(c).replace("::", ".");
var className:String = getQualifiedClassName(c).replace("::", ".");
return className;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.