给定以下代码:
import flash.utils.Dictionary;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
public class CDictionary extends Dictionary
{
public function CDictionary(weakKeys:Boolean=false)
{
super(weakKeys);
}
}
这会引发错误 #1056:
m_cdictNearIDs = new CDictionary();
m_cdictNearIDs[4] = "f";
但这不是:
m_cdictNearIDs = new Dictionary();
m_cdictNearIDs[4] = "f";
(在每种情况下,它都是一个成员变量,它被声明为与它被实例化的类型相同。)Wth?从字典继承的技巧是什么?谢谢!