请教一下:
1、removeChildren的对象是否只有在
移除自身的事情监听,移除自身的timer监听、移除所有引用的情况下才可能被清除?
2、我把下面的对象添加到stage中
var SightBead = (function () {
function sightBeadSprite() {
SightBead.super(this);
this.name = 'sightBead';
this.graphics.drawCircle(0,0,40,null,'#ff0000',1);
this.graphics.drawLine(-45,0,45,0,'#ff0000',1);
this.graphics.drawLine(0,45,0,-45,'#ff0000',1);
this.alpha = 0;
Laya.stage.addChild(this);
// this.pos(440,640);
}
Laya.class(sightBeadSprite, "SightBead", Laya.Sprite);
return sightBeadSprite;
}());
然后如此使用destroy
[code]for (var i = 0; i < Laya.stage.numChildren; i++) {
var object = Laya.stage.getChildAt(i);
// object.removeSelf();
Laya.stage.removeChildAt(i);
object.destroy(true);
}[/code]该对象继续在屏幕上显示。。。(IDE版本1.7.10.bate)
使用Laya.stage.destroyChildren();是可以移除该对象的