推 liuguai:感謝你的回答^^問題解決了! 05/01 20:50
※ 引述《liuguai (小乖)》之銘言:
: 我做了一個按鈕
: 是想要用ActionScript去控制
: rollover 跟 release
: 可是現在按下去會亂掉阿><
: 新手急問
: 希望有人能幫助我><
: 原始檔http://192.192.155.219/liuguai/all.fla
: swf檔 http://192.192.155.219/liuguai/all.swf
因為當你圖片滑走的時候
就會觸發onRollOut
然後之後又一直重複處發onRollIn和onRollOut
因為圖片一直 "移到滑鼠下面、移開滑鼠下面、移到滑鼠下面..." 這樣
我的做法是
把那個元件上面的on handler全部去掉
然後bj3的第一格打上下列code
function rOver():Void {
gotoAndPlay(2);
this.onRollOver = null; //移除 onRollOver
this.onRollOut = rOut; //設定 onRollOut 為 rOut
this.onRelease = mouseRelease; //設定 onRelease 為 mouseRelease
}
function rOut():Void {
gotoAndPlay(9);
this.onRollOver = rOver; //設定 onRollOver 為 rOver
this.onRollOut = null; //移除 onRollOut
this.onRelease = null; //移除 onRelease
}
function mouseRelease():Void {
gotoAndPlay(19);
this.onRollOut = null; //移除 onRollOut
this.onRelease = null; //移除 onRelease
}
this.onRollOver = rOver; //設定 onRollOver 為 rOver
這樣會一按下去之後就一直跑到最後一格,不會回來了
如果要回來,請在最後一格加上
this.onRelease = function():Void {
gotoAndStop(1); //跳回第一格
this.onRelease = null; //移除此功能
}
--
CJ Cat = Croa'J Cat = Cockroach Cat = 西街凱特 = 蜚蠊貓 = 蟑螂貓
Blog http://cjcat.blogspot.com
Gallery http://cjcat2266.deviantart.com
ptt2 Board CJWorkshop - 阿多比閃光(Adobe Flash)研討區
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.228.84.82