作者wegerx (wegerx)
看板Flash
标题Re: [问题] 请问倒带按钮的程式码!?
时间Thu Nov 3 12:53:19 2005
※ 引述《cold34 (cold34)》之铭言:
: 找过粉多书~~都只有教play和 stop 没有教到倒带.....
: 有人可以教教我吗???
: 可以再顺便提供我一些有关制做 flash 的网站吗?
: 想做点东西出来~~~谢谢^^
之前有板友写出来,但是不知在哪篇,可是我有存档(原作请见谅):
不断快转或倒带的语法:
在scene的frame 1加上这个:
function prev(target) {
target.gotoAndStop(target._totalframes);
target.onEnterFrame = function() {
if (this._currentframe>1) {
this.gotoAndStop(this._currentframe-1);
} else {
delete this.onEnterFrame;
}
};
}
你希望播放的动画作成MC放在scene里,实体名称假设是mc_1,
那麽你只要在<<倒带按钮上写
on (press) {
_root.prev(_root.mc_1);
}
他就会一直倒到第一格了,第一格记得写个stop();
播放>>的部份,只要
on (press) {
_root.mc_1.play();
}
就好
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.165.94.212