2014-07-26 2 views
0

나는 학교에서 나올 때 실제 스크립트 3을 가지고 몇 년 전에 시작했고, 내가 가진 첫 번째 직업은 액션 스크립트 2에 들어가야했다. 그래서 약 3 년 동안 액션 스크립트 2, 나는 액션 스크립트 3을 잊어 버렸습니다. 이것은 대부분 습득 한 모든 자습서 등이 클래스와 퍼블릭 함수 및 기타 등등을 사용하기 때문에 마음이 거의 마비됩니다.Actionscript 2 코드를 Actionscript 3으로 옮기기

우리가 실행할 수있는 기본적인 슬라이드 쇼 전체 아이디어 swf 파일 또는 exe로. 대부분의 코드는 gotoAndStop 또는 gotoAndPlay 명령입니다. 토글과 네비게이션 mebu 덕분에 as3의 엄격한 클래스 기능 중 약간의 배타적 태생이되었습니다.

swf 파일 시작시 나타나는 하나의 대상 메뉴가 있습니다. 이 단추를 클릭하면 다음 단계로 이동하거나 추가 단계로 넘어갑니다. 아래 코드를 참조하십시오. 버튼 ("메뉴"라고 함)은이 메뉴를 클릭하면 시각적으로 전환됩니다. prev_btn과 next_btn은 메뉴 버튼의 인접한면에 위치하여 다음 프레임 레이블이나 특이한 프레임 레이블로 이동할 수 있습니다.

언제든지 메뉴 버튼을 눌러 메인 메뉴를 불러올 수 있습니다. 여기에서 타임 라인의 다른 단계로 이동할 수 있습니다.

그래서 같은 그래픽과 사용 편의성을 유지하는 방법을 알 수 없습니다. AS3로 번역

//fscommands that set up the exit and fullscreen functions 
fscommand("fullscreen", "true"); 
fscommand("allowscale", "false"); 
fscommand("showmenu", false); 

navmenu._visible=0; 
menu_btn.onRelease=function() 
    { 
     navmenu._visible=1; 
    } 

//******************Initialization When Program first starts********************* 

_global.initialize=function(){ 
    gotoAndStop("sc1-step0-0"); 
}; 


exit_btn.onRelease = function() { 
    fscommand("quit"); 
}; 


reset_btn.onRelease = function() { 
    initialize(); 
}; 


callouts_btn.onRelease = function(){ 
    if (callouts_mc._visible == true) { 
     callouts_mc._visible = false; 
    }else{ 
     callouts_mc._visible = true; 
    } 
}; 


highlight_btn.onRelease=function(){ 
    ToggleHighlights(); 
} 


function ToggleHighlights(){ 
    showHighlights = !showHighlights; 
    if(showHighlights){ 
     highlights_mc.gotoAndPlay("show"); 
    } 
    else{ 
     highlights_mc.gotoAndPlay("hide"); 
    } 
} 

function ShowHighlights(){ 
    if(showHighlights){ 
     highlights_mc.gotoAndPlay("show"); 
    } 
    else{ 
     highlights_mc.gotoAndPlay("hide"); 
    } 
} 

//*******Start Program********** 

initialize(); 

prev_btn.onRelease=function(){ 
    gotoAndPlay("sc1-step1-0"); 
} 

next_btn.onRelease=function(){ 
    gotoAndPlay("sc1-step3-0"); 
} 
+0

함수 ShowHighlights()를 사용하지 않는,하지만 난 당신의 전체 코드를 번역했다. – helloflash

답변

0

, 여기에 표시 코드는이 제공 :

stage.displayState = StageDisplayState.FULL_SCREEN; 
stage.scaleMode = StageScaleMode.NO_SCALE; 
stage.showDefaultContextMenu = false; 

var showHighlights:Boolean = false; 
navmenu.visible = false; 

menu_btn.addEventListener(MouseEvent.MOUSE_UP, menuVisible); 

function menuVisible(e:MouseEvent):void { 
    navmenu.visible = true; 
} 

exit_btn.addEventListener(MouseEvent.MOUSE_UP, toQuit); 

function toQuit(e:MouseEvent):void { 
    fscommand("quit"); 
} 

reset_btn.addEventListener(MouseEvent.MOUSE_UP, init); 

function init(e:MouseEvent):void { 
    initialize(); 
} 

function initialize():void { 
    gotoAndStop("sc1-step0-0"); 
} 

callouts_btn.addEventListener(MouseEvent.MOUSE_UP, callouts_mcVisible); 

function callouts_mcVisible(e:MouseEvent):void { 
    callouts_mc.visible = !callouts_mc.visible; 
} 

highlight_btn.addEventListener(MouseEvent.MOUSE_UP, ToggleHighlights); 

function ToggleHighlights(e:MouseEvent):void { 
    showHighlights = !showHighlights; 
    if (showHighlights) 
    { 
     highlights_mc.gotoAndPlay("show"); 
    } 
    else 
    { 
     highlights_mc.gotoAndPlay("hide"); 
    } 
} 

function ShowHighlights(e:MouseEvent) { 
    if (showHighlights) 
    { 
     highlights_mc.gotoAndPlay("show"); 
    } 
    else 
    { 
     highlights_mc.gotoAndPlay("hide"); 
    } 
} 

//*******Start Program********** 

initialize(); 

prev_btn.addEventListener(MouseEvent.MOUSE_UP, gotoPrev); 

function gotoPrev(e:MouseEvent):void { 
    gotoAndPlay("sc1-step1-0"); 
} 

next_btn.addEventListener(MouseEvent.MOUSE_UP, gotoNext); 

function gotoNext(e:MouseEvent):void { 
    gotoAndPlay("sc1-step3-0"); 
} 
+0

정말로 도움을 주셔서 감사합니다. 나는 내가 가장 중요하게 생각하는 문제는 대부분 민간 및 공공 기능과 수업 외 활동을 사용한다는 것입니다. 이것들은 플래시 CS6에서 내보내는 모든 exe ​​파일입니다. –

관련 문제