AS3.0学习手记(3)Flash CS3的深度控制

var b:mc = new mc();
var c:mcc = new mcc()
this.addChild(b);
this.addChild(c);
c.x=10;
this.addChildAt(c,0)//可以设置深度
this.setChildIndex(c,0)//调整深度 相当于swapDepth()
trace(this.getChildIndex(c));
// 得到深度,相当于getDepth()

trace(stage.numChildren-1)//获取层深的总数


About this entry