添加元素时,有Name属性
var child = parent.addChild(label, 1, "元素的名字");
或者给child设置tag
child.setTag("TAG");
然后,就可以从父亲中,获取此子类
var c = parent.getChildByName("元素的名字");

var c = parent.getChildByTag("TAG");
移除元素也很简单:
parent.removeChild(child);

parent.removeChildByTag("TAG");
或者
child.removeFromParent();

posted on 2016-10-02 08:43  siegel  阅读(474)  评论(0编辑  收藏  举报