2009-05-01 11 views

답변

1

AS3 공정한 비트를 변경했다 당신에 "에 사용하는 경우 (누르십시오) "단추 부호.

이것은 완벽한 비디오 자습서입니다 Getting Started with AS3 - Simple Buttons. AS2에서 오는 사람들을 위해 AS3에서 단추의 기본 사항을 설명합니다. 이것은 당신에게 좋은 개요를 제공해야합니다.

1
import flash.events.MouseEvent; 

...

buttonA.addEventListener(MouseEvent.CLICK, onPressPrev); 
buttonB.addEventListener(MouseEvent.CLICK, onPressNext); 

private function onPressPrev(e:MouseEvent=null):void{ 
    prevFrame(); 
} 
private function onPressNext(e:MouseEvent=null):void{ 
    nextFrame(); 
} 

private function prevFrame():void{ 
    gotoAndStop(currentFrame-1) 
} 
private function nextFrame():void{ 
    gotoAndStop(currentFrame+1) 
} 

희망이 몇 가지 도움이됩니다. 이미 새로운 MouseEvent 구조에 대한 답변이 이미있는 것 같습니다. 버튼 이벤트 핸들러를 작성

0

짧은 방법은 당신이 이렇게 이렇게 비 OOP을하고 볼 //이

var btn:SimpleButton; 

btn.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void{ 
    //do your code for the click here 
    nextFrame(); 
}); 
1

처럼, 두 번째 프레임에 배치합니다. 원하는대로 수정하십시오. 타임 라인 전체에 버튼이 없는지 확인하십시오. 트윈이 있다면 화면에서 그냥 움직이십시오.

import flash.display.MovieClip; 
import flash.events.MouseEvent; 

urlbutton.addEventListener(MouseEvent.CLICK, urlfunc); 
urlbutton.useHandCursor = true; 


function urlfunc(myEvent:MouseEvent){ 
    var request:URLRequest = new URLRequest("siteurl"); 
    navigateToURL(request, "_blank"); 
    } 

continuebutton.addEventListener(MouseEvent.CLICK, continuefunc); 
continuebutton.useHandCursor = true; 

function continuefunc(myEvent:MouseEvent){ 
    gotoAndPlay('playgame'); 
    } 
0

AS2의 경우이 코드를 사용하고 있습니다. 기능 및 버튼 이름의 이름입니다 AS3

는 (버튼)라고 곳에는 그래서
LIST.addEventListener(MouseEvent.CLICK, Button) 


function (Button)(evt:MouseEvent){ 
    gotoAndStop(2) 
} 

를 들어

on(release){ 
    gotoAndStop(2); 
{ 

.