2011-09-16 65 views
0

我是Flash新手....這是我想要做的。我在時間線上工作,並有一些Actionscript 3代碼(我在時間軸上有一個動作層)。我不確定點擊一個按鈕的代碼是什麼(我製作了電影剪輯按鈕,因爲我想爲它設置動畫效果),它播放一個影片剪輯。任何幫助,將不勝感激!由於當我點擊按鈕時,如何播放影片剪輯

+1

你應該問之前谷歌。 – 2011-09-17 04:48:33

回答

0

假設你有一個按鈕(影片剪輯)名爲「myButton的」,並命名爲「targetMc」在舞臺上一個影片剪輯,你可以做這樣的:

myButton.buttonMode = true; // set the movieclip to act as a button 
myButton.addEventListener(MouseEvent.CLICK, onButtonClick); // add mouse listener 

function onButtonClick(event : Event) : void 
{ 
    trace("clicked" + event.target); 
    //gotoAndPlay("someFrameLabel"); // plays frame in current timeline 
    targetMc.gotoAndPlay("someFrameLabel"); // plays frame in instance "targetMc" timeline 
} 
相關問題