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;
}
}