Professional Documents
Culture Documents
Activity Moving Ball
Activity Moving Ball
onClipEvent (EnterFrame) {
if (dir == 0) {
this._x +=5;
if (this._x > 650) {
dir = 1;
}
} else if (dir ==1) {
this._x -=5;
if (this._x < 100) {
dir = 0;
}
}
}
3. Create a button
4. In the button action panel type the following scripts:
on(press){
if (ball2.dir == 1){
ball2.dir = 0;
} else if (ball2.dir ==0) {
ball2.dir=1;
}
}
Members Name:
_________________________
_________________________
_________________________
_________________________
_________________________