function DrawBox(sName,fc,bc,w,h,x,y,dpth,opc,speed){
ref = _root.createEmptyMovieClip(sName,dpth);
ref.lineStyle(0,0xFFFFFF,100);
ref.moveTo(x,y);
ref.lineStyle(0,bc,opc);
ref.beginFill(fc,opc);
ref.lineTo(x+w,y);
ref.lineTo(x+w,y+h);
ref.lineTo(x,y+h);
ref.lineTo(x,y);
ref.endfill();
ref.onEnterFrame = function(){
this._X -= _root.randomX;
this._X *= speed;
this._X += _root.randomX;
this._Y -= _root.randomY;
this._Y *= speed;
this._Y += _root.randomY;
if(xxx>24){setStage()}
};
}
function setStage(){
xxx=1;
randomX = random(stage.width);
randomY = random(stage.height);
}
onLoad(){
DrawBox("box",0x666666,0x000000,5,5,0,0,25,50,0.9) ;
}
onEnterFrame(){
xxx++;
if(xxx>48){setStage()}
_root.lineStyle(0,0x333333,25);
_root.lineTo(box._X+2.5,box._Y+2.5);
}