reflection method in actionscript:
//refelction method
protected function getDisplayObjectInstance(skin:Object):DisplayObject{
var classDef:Object;
if(skin is Class){
return new skin() as DisplayObject;
}else if(skin is DisplayObject){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return skin as DisplayObject;
}
try{
classDef = getDefinitionByName(skin.toString());
}catch(e:Error){
try{
classDef = loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object;
}catch(e:Error){
//nothing
}
}
if(classDef == null){
return null;
}else{
return new classDef() as DisplayObject;
}
}
分享到:
相关推荐
Budget-based Popularity-aware Search Mechanism in Unstructured P2P Networks
In addition, the C++ reflection mechanism used by our library to bind to database tables allows us to add generic indexing and lookup properties to our containers with no special code required from ...
A Strategy-Proof Radio Spectrum Auction Mechanism in Noncooperative Wireless Networks
TA2内绝热剪切带的微观组织演化机制探讨,杨扬,熊俊,研究了工业纯钛(TA2)在 ≈105~106/s时产生的绝热剪切带(ASB)的微观组织演化机制。TEM观察表明ASB由平均直径为50 nm的具有再结晶特征的
Precise Failure Location and Protection Mechanism in Long-Reach Passive Optical Network
Chapter 6 The Mechanism of Transcription in Bacteria (2020)
In this paper, a sharp-front laser is proposed to irradiate a triple-layer target (the proton layer is set between two carbon ion layers) and studied in theory and simulations. It is found that the ...
advances in wireless networking technologies. It aims to facilitate user tasks through seamless utilization of services available in the surrounding environments. In such distrib- uted environments ...
A MECHANISM OF MANAGEMENT OF TRUST VALUE OF WEB SERVICE IN P2P ENVIRONMENT,杨静波,,Peer to Peer (P2P) systems become more and more popular and bring both opportunities and threats. In the issues of...
复杂产品供应链创新的合作机制,刘亮,刘学鹏,通过分析供应链协调机制的现状,本文提出了复杂产品生产商和供应商风险分担协作发展的模型。在合适的激励和利润分配模式下,该模
The original article contained a spelling error in the first author’s name. The correct name is shown here.
A possible mechanism of current in medium under electromagnetic wave,张涛,,A possible mechanism of current in medium was presented. Comparison between this current and the magnetization current was...
新的时空概念和氖壳中的时空维卷曲机制,许昆明,,传统的欧氏几何无法准确地描述电子在原子中的运动状态,即使是最简单的氢原子中的一个电子,采用薛定鄂方程求解也是很烦琐的事。
Congestion Control Mechanism in Delay Tolerant Networks
气相爆轰类涡诱导机理数值分析,王昌建,郭长铭,本文基于全NS方程,考虑粘性、热传导、分子扩散和湍流的影响,目的是研究气相爆轰流场类涡结构及其诱导机理。采用基元反应描述爆�
Biocatalytic mechanism of monolignols biotransformation by Rhus laccases in water-miscible organic solutions,万云洋,宫腰哲雄,Important monolignols such as coniferyl alcohol were catalyzed by Rhus ...
强垂直磁各向异性CoPt/AlN多层膜的反向磁化机理研究,俞有幸,史绩,本文研究了强垂直各向异性CoPt/AlN纳米多层薄膜的反向磁化机理。利用高真空对靶磁控溅射镀膜技术在石英基底上制备了AlN(5 nm)/[CoPt(2 nm)/
MPLS网络中的一种抵御网络攻击的安全机制,郑映,Hu Hanping,多标签转发协议为数据包的传输定制了预定的转发路径。然而在这些转发路径上的网络节点很可能会受到攻击者的攻击。在MPLS网络中,��
Collaborative Synchronization Mechanism in Wireless Multimedia Sensor Networks
Balance Transmission Mechanism in Underwater Acoustic Sensor Networks