---恢复内容开始---
var y1_mc:yuan1;
var yArray:Array = new Array();
for (var i:int =0; i<8; i++) {
y1_mc=new yuan1();
y1_mc["txt"].text = "框:" + i;
this.addChild(y1_mc);
rand();
yArray.push(y1_mc);
}
function rand():void {
var mcy:uint = Math.random()*(480-100);
var mcx:uint=Math.random()*(320-100);
y1_mc.y=mcy;
y1_mc.x=mcx;
for (var j:int =0; j<yArray.length; j++) {
/*if(Math.abs(y1_mc.x - yArray[j].x) < 80||Math.abs(y1_mc.y - yArray[j].y) < 80){
trace(y1_mc.x)
rand();
trace("完全:" + y1_mc.x)
break;
}
return;*/
if (y1_mc.hitTestObject(yArray[j])) {
//trace("碰");
rand();
break;
}
}
}
---恢复内容结束---