ball1.scaleX=ball1.scaleY = 0.6+Math.random() * 0.3;
ball2.scaleX=ball2.scaleY = 0.6+Math.random() * 0.3;
ball3.scaleX=ball3.scaleY = 0.6+Math.random() * 0.3;
ball1.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball2.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball3.addEventListener(Event.ENTER_FRAME, onEnterframe);
function onEnterframe(e:Event): void {
var mc:MovieClip = e.target as MovieClip;
if ((mc.x - mc.width/2)> stage.stageWidth){
mc.x =- mc.width/2;
}else {
mc.x+=mc.width * 0.2;
}
}
0 件のコメント:
コメントを投稿