0
我正在嘗試清理添加到MovieClip中的某些類,但似乎無法將MovieClip(Class)設置爲null。什麼是正確的方法來做到這一點?清理MovieClip中的嵌套動態影片剪輯(Class)
private var mcHolder:MovieClip = new MovieClip()
private var mcClass:MovieClip
private function someFunction():void
{
mcClass = new SomeClass()
mcHolder.addChild(mcClass)
}
private function clean():void
{
i = mcHolder.numChildren
if (i > 0)
{
while (i--)
{
MovieClip(mcHolder.getChildAt(i)).clean()
**MovieClip(mcHolder.getChildAt(i)) = null**
mcHolder.removeChild(MovieClip(mcHolder.getChildAt(i)))
}
}
}