[問題] 用flash製作擲骰子的ActionScript

看板Flash作者 (沒啥好說的!)時間13年前 (2011/11/13 13:32), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/2 (看更多)
目前在製作一個擲骰子的Flash, 可否幫我看一下ActionScript中的if哪裡有錯誤? (fred是第一個骰子,etherl是第二個骰子) 有三個if, 第一個是當擲出兩個點數相同的骰子時,會出現"You won!"的文字; 第二個是當擲出兩個點數和為七的時候,會出現"You lose!"的文字; 第三個是既不是相同點數也不是七的時候,不會出現任何文字。 fred.stop(); ethel.stop(); fred.buttonMode=ethel.buttonMode=true; function rollDice(MouseEvent){ fred.gotoAndStop(Math.ceil(Math.random()*6)); ethel.gotoAndStop(Math.ceil(Math.random()*6)); if(fred==ethel){ doubles_txt.text="You won!"; } if(fred+ethel=7){ seven_txt.text="You lose!" }else{ doubles_txt.text=""; seven_txt.text=""; } } fred.addEventListener(MouseEvent.CLICK, rollDice); etherl.addEventListener(MouseEvent.CLICK, rollDice); 謝謝! ※ 編輯: sxazdc 來自: 75.13.92.16 (11/13 13:34) ※ sxazdc:轉錄至看板 CodeJob 11/13 13:37 ※ 編輯: sxazdc 來自: 75.13.92.16 (11/13 14:01)

11/13 21:09, , 1F
if(fred+ethel==7)
11/13 21:09, 1F
文章代碼(AID): #1ElrPRrm (Flash)
文章代碼(AID): #1ElrPRrm (Flash)