2012-12-22
ActionScriptの練習
-
ボールをループさせる
Gadgets powered by Google |
var speed:Number;
var leftEdge:Number;
var rightEdge:Number;
this.onLoad = function() {
speed = 10;
leftEdge = -20;
rightEdge = 520;
}
ball_mc.onEnterFrame = function() {
ball_mc._x += speed;
if(ball_mc._x >= rightEdge){
ball_mc._x = leftEdge;
}
}