CODE:private function syncFun(e:ApplySocketEvent):void{
如果没看懂,还有虾米问题,就跟贴吧。。。
var tmpAr:Array = e.data as Array;
for(var i:int = 0; i < tmpAr.length; i ){
var ar:Array = tmpAr[i];
var _index:String = ar[1];
if(_index != index && (has(_index) || ar[0] == "create")){
switch(ar[0]){
case "create":
createTank(_index);
break;
case "move":
var moveStr:String = ar[2];
var moveAr:Array = moveStr.split("");
get(_index).move(expBoo(moveAr[0]),expBoo(moveAr[1]),expBoo(moveAr[2]),expBoo(moveAr[3]));
moveAr = null;
break;
case "bullet":
get(_index).bullet();
break;
case "shell":
get(_index).shell();
break;
case "turn":
var turnStr:String = ar[2];
var turnAr:Array = turnStr.split("");
get(_index).turn(expBoo(turnAr[0]),expBoo(turnAr[1]));
break;
}
}
ar = null;
}
tmpAr = null;
}
新闻热点
疑难解答