0
我爲我的項目使用了ActionScript 2.0。我有一個定時器和一個沿x軸移動的影片剪輯。如果該影片剪輯到達給定邊界,它將消失並添加定時器的速度。我的問題是我無法添加計時器的速度。這裏是我的計時器代碼:Actionscript 2.0計時器
stop();
var hour:Number = 0;
var minute:Number = 0;
var second:Number = 0;
hours.text = "0" + hour;
minutes.text = "0" + minute;
seconds.text = "0" + second;
timerClip.onEnterFrame = function(){
if(this._currentframe == 30){
second += 1;
if (second > 59){
second = 0;
seconds.text = "0" + second;
minute += 1;
minutes.text = "0" + minute;
} else {
if (second >= 10) {
seconds.text = second;
} else {
seconds.text = "0" + second;
}
if (minute == 1){
gotoandstop(2);
}
}
}
}
這裏是我爲我的影片剪輯代碼:
onClipEvent (load) {
speed = 1;
boundary = 280;
}
onClipEvent (enterFrame) {
if (this._x > boundary) {
this._x -= speed;
}
else {
this._x = boundary;
this._visible = false;
}
}