2013-02-18 73 views
0

我的Flash項目中的「環視」按鈕僅在您每次點擊它時才起作用。我所有的其他按鈕都有相同的代碼並且工作正常。這裏是我的ActionScript代碼:按鈕只能在閃存中每隔一段時間工作

import flash.events.Event; 

escape_btn.addEventListener(MouseEvent.CLICK, pressedEscape) 
function pressedEscape(event:MouseEvent):void 
{ 
    animations.gotoAndPlay("escape"); 
} 

bio_btn.addEventListener(MouseEvent.CLICK, pressedBio); 
function pressedBio(event:MouseEvent):void 
{ 
    gotoAndStop("biography"); 
} 

home_btn.addEventListener(MouseEvent.CLICK, pressedHome); 
function pressedHome(event:MouseEvent):void 
{ 
    gotoAndStop("home"); 
} 

analysis_btn.addEventListener(MouseEvent.CLICK, pressedAnalysis); 
function pressedAnalysis(event:MouseEvent):void 
{ 
    gotoAndStop("analysis"); 
} 

lookaround_btn.addEventListener(MouseEvent.CLICK, pressedLookAround) 
function pressedLookAround(event:MouseEvent):void 
{ 
    animations.gotoAndPlay("look around"); 
} 


stop(); 

這裏是我的動畫時間軸的一些截屏: enter image description here enter image description here enter image description here enter image description here

+0

你發佈的內容看起來很好。大概在動畫的某個地方出現問題 – 2013-02-18 03:54:43

+0

我從我的時間線中添加了屏幕截圖,希望這會有所幫助 – JR34 2013-02-18 05:55:59

回答

1

我懷疑問題出在同一框架上的操作爲「東張西望」標籤。

我猜那裏有一個stop()命令;在使用gotoAndPlay時發現,如果在gotoAndPlay跳轉到的幀上也有stop(),則可能會出現問題。閃光燈變得混亂,因爲它被告知要玩,但也要停下來。

+0

您說的stop()與「look around」標籤在同一幀中是正確的。我在「look around」標籤之前添加了一個關鍵幀,並在其中放置了stop()命令。謝謝! – JR34 2013-02-18 14:30:44

相關問題