addChild的作用
password:function(event,num)
{
if(num === '<--')
{
cc.log(this.num);
if(this.num === 0)
{
return;
}
for(var i =0;i<this.num-1;i++)//小于4防止 i+1 溢出
{
this.window[i].string = this.window[i+1].string;//把前面的值赋值给后面 4---0
}
this.num--;
//直接覆盖最大下标为5递减,跟上面的赋值前移的结合就可以有删除从0开始删除的感觉
this.window[this.num].string = "";//this.window[5]为 "";
return;
}
if(num==='c')
{
for(var i in this.window)
{
this.window[i].string = "";
}
this.num=0;
}
if(this.num===6)
{
return;
}
for(var i = this.num; i>0 ;i--)
{
this.window[i].string = this.window[i-1].string;
}
if(num!=='c'&&num!=='<--'&&this.num<=5)
{
this.window[0].string = num;
this.num++;
cc.log(this.num);
}
},