主题:  Flash中使帧停顿一段时间的源代码

solohawk

职务:普通成员
等级:2
金币:1.0
发贴:398
注册:2001/10/12 14:29:38
#12003/3/11 11:09:55
pauseDuration = 5*1000;
framesinLoop = 1;

if (startTime == null) {
startTime = getTimer();
gotoAndPlay(_currentframe-framesinLoop);
} else {
lapsedTime = getTimer()-startTime;
if (lapsedTime < pauseDuration) {
gotoAndPlay (_currentframe-framesinLoop);
} else {
startTime = null;
gotoAndPlay (_currentframe+1);
}
}

pauseDuration为停顿时间

framesinLoop为与当前帧构成循环的帧数差(可以为任何数)

startTime为停顿开始时间

_currentframe为当前帧



solohawk

职务:普通成员
等级:2
金币:1.0
发贴:398
注册:2001/10/12 14:29:38
#22003/3/11 15:28:03
什么意思?



流感

职务:普通成员
等级:1
金币:1.0
发贴:214
注册:2002/11/3 6:00:56
#32003/3/12 20:47:03
stop();
t=getTimer();
_root.onEnterFrame = function() {
     if ((getTimer()-t)>3000) {
        _root.play();
        }
        };
这样也可能