감사 : 스크립트가 실행 할 때 버튼을 타임 라인에 존재해야합니다.
button1.addEventListener(MouseEvent.CLICK, onClickHandler);
button2.addEventListener(MouseEvent.CLICK, onClickHandler);
button3.addEventListener(MouseEvent.CLICK, onClickHandler);
private function onClickHandler(event : MouseEvent) : void
{
switch(event.target)
{
case button1:
// code to execute when button 1 is clicked
gotoAndPlay(50);
break;
case button2:
// code to execute when button 2 is clicked
gotoAndPlay(100);
break;
case button3:
// code to execute when button 3 is clicked
gotoAndPlay(150);
break;
}
}