✔ 最佳答案
係得既,不過要用actionscript,唔知你應唔應付得黎喎
首先你要將2個button既"實體行為"(instance behavior)改做"影片片段"(movie clip)屬性,即係要highlight個button,去"屬性"(properties)下面既"實體行為"(instance behavior),將"按鈕"(button)轉做"影片片段"(movie clip)
而"實體行為"(instance behavior)下面有個名"實體名稱"(instance name)既空格,我就將其中一個按鈕叫 a_btn,另一個按鈕叫 b_btn 咁話啦,其實你鐘意叫咩名都冇所謂
好啦,跟住你要highlight住有果兩個按鈕既"影格"(frame),然後開"動作"(action)視窗,響視窗入面請打:
var top:Number = Math.max(a_btn.getDepth(), b_btn.getDepth());
a_btn.onRollOver = function() {
if (a_btn.getDepth() != top) {
a_btn.swapDepths(b_btn);
}
}
b_btn.onRollOver = function() {
if (b_btn.getDepth() != top) {
b_btn.swapDepths(a_btn);
}
}
咁樣每當你滑入個按鈕既時候,個按鈕就會變左放響另一個按鈕的上面
如果有咩唔明,請再問,我希望我解釋得清楚
2007-04-14 22:56:43 補充:
可以係可以整既,不過有d複雜,我驚響度未必完全解釋到你介唔介意俾個msn我?我可以響msn慢慢教你如果你介意,我都冇所謂,我盡量響度簡短d咁教你都得,隨你喜歡
2007-04-15 19:56:37 補充:
如果係7個都得既,但係請問你係咪用緊我現時講既方法?姐係將button變做movie clip的做法,還是你用了其他方法?我可以盡量就你咁幫你諗一個方法既
2007-04-15 23:53:31 補充:
我假如你d按鈕既instance_name係a_btn、b_btn、c_btn…g_btn我假設你一開始既setting係a_btn在b_btn之上,b_btn在c_btn之上,如此類推跟住響你放buttons果個影格到,輸入actoinscript:
2007-04-15 23:54:17 補充:
var buttons:Array = new Array();buttons[0] = a_btn;buttons[1] = b_btn;buttons[2] = c_btn;buttons[3] = d_btn;buttons[4] = e_btn;buttons[5] = f_btn;buttons[6] = g_btn;
2007-04-15 23:55:12 補充:
function bringOnTop(b:MovieClip) { if (buttons[0] == b) { return; } var foundClip:Boolean = false; for (i=6; i 0; i--) { if (buttons[i] == b) { foundClip = true; }
2007-04-15 23:55:48 補充:
if (foundClip) { buttons[i].swapDepths(buttons[i-1]); var temp:MovieClip = buttons[i]; buttons[i] = buttons[i-1]; buttons[i-1] = temp; } }}for (i=0; i
2007-04-15 23:57:37 補充:
sorry,續上:for (i=0; i<7; i++) { buttons[i].onRollOver = function() { bringOnTop(this); };}
2007-04-16 00:00:39 補充:
sorry,因為yahoo 知識既問題,有d符號出唔到:有一行for (i=6; i 0; i--) {,請改為: for (i = 6; i 0; i--) {如果你run既時候run唔到,請通知一聲,因為yahoo知識有時唔係好show到d 符號
2007-04-17 03:44:22 補充:
冇錯,係要將:for (i = 6; i 0; i--) {轉做:for(i=6;i>0;i--){yahoo 知識成日都show唔到d符號,好煩sorry之前令你誤會