AS2

2017-11-07 5 views
0

내가 플래시 파일에 액션이 사용했지만 액션이 어떤 브라우저가 지원하지 않기 때문에 내가하려고하는 동안, 나는 액션 3.AS2

내 액션이 코드를 변경해야 Adobe Animate를 사용하여 변환하면 프리 로더, 초기 설정, 세로/가로 맞춤 등으로 이미지로드에 오류가 표시되기 시작합니다.

코드 및 오류 메시지는 아래와 같습니다 :

//Controls Default 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
controls.zo.useHandCursor = false; 
controls.zi.useHandCursor = false; 
controls.br.useHandCursor = false; 
controls.bl.useHandCursor = false; 
controls.bu.useHandCursor = false; 
controls.bd.useHandCursor = false; 
controls.bres.useHandCursor = false; 
resized_ = false; 
cursor._visible = panWithinBoundary ? false : true; 
//Image loading with preloader (if the settings made to load the image dynamically) 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
if (image ne undefined and image ne "" and image ne null) { 
    //If image path specified: 
    controls._visible = false; 
    mcl = new MovieClipLoader(); 
    tempMc = content_clip.inner_clip.ImageHolder.Content.createEmptyMovieClip("temp", 1); 
    mcl.loadClip(image, tempMc); 
    mcl.onLoadStart = function() { 
     //Image loading progress 
     loader.start_(tempMc); 
    }; 
    mcl.onLoadInit = function(mc) { 
     //After loading the image: 
     if (imageSmoothing and image.substr(image.lastIndexOf(".")+1) ne "swf") { 
      //If imageSmoothing is set 'true' and the content is not swf, we need to capture the bitmap data 
      //for better look:If imageSmoothing is set 'false' or the content is not an image (but swf), 
      //we should show the content 'as is' without bitmap capture. 
      myBmp = new flash.display.BitmapData(mc._width, mc._height, true, 0x00CCCCCC); 
      myBmp.draw(mc); 
      removeMovieClip(mc); 
      content_clip.inner_clip.ImageHolder.Content.attachBitmap(myBmp, 0, "auto", true); 
     } 
     loader.unloadMovie(); 
     bgShade.unloadMovie(); 
     init(); 
     run(); 
    }; 
} else { 
    //If image path not specified, then assuming image is placed directly to the library: 
    loader.unloadMovie(); 
    bgShade.unloadMovie(); 
    init(); 
    run(); 
} 
//Initial settings 
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
function init() { 
    recent = 0; 
    posx = posy=0; 
    canvasSize(); 
    iw = cW; 
    ih = cH; 
    mask_._width = hit._width=iw; 
    mask_._height = hit._height=ih; 
    cr_width = iw; 
    cr_height = ih; 
    ease = ease<1 ? 1 : ease; 
    zoomFactor = zoomFactor<.3 ? .3 : zoomFactor; 
    panSpeed = panSpeed<1 ? 1 : panSpeed; 
    mSP = 1; 
    mPX=_xmouse, mPY=_ymouse; 
    //Aligning Control box+++++++++++++++++++++++++++++++++++++++++++++ 
    //Vertical Align 
    controls._visible = true; 
    if (controlBoxVAlign.toLowerCase() eq "top") { 
     controls._y = controlBoxSpace; 
    } else if (controlBoxVAlign.toLowerCase() eq "middle" or controlBoxVAlign.toLowerCase() eq "center" or controlBoxVAlign.toLowerCase() eq "centre") { 
     controls._y = (ih/2)-(controls._height/2); 
    } else { 
     controls._y = ih-controls._height-controlBoxSpace; 
    } 
    //Horizontal Align 
    if (controlBoxHAlign.toLowerCase() eq "left") { 
     controls._x = controlBoxSpace; 
    } else if (controlBoxHAlign.toLowerCase() eq "middle" or controlBoxHAlign.toLowerCase() eq "center" or controlBoxHAlign.toLowerCase() eq "centre") { 
     controls._x = (iw/2)-(controls._width/2); 
    } else { 
     controls._x = iw-controls._width-controlBoxSpace; 
    } 
    //Initial Zoom level detection. By default, the image gets scaled to the variable value "sc" to fit it within stage atleast to one side 
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
    sc = (ih/content_clip.inner_clip.ImageHolder._height)*100; 
    if (!zoomOutToExtreme) { 
     if (content_clip.inner_clip.ImageHolder._width*(sc/100)<iw) { 
      sc = (iw/content_clip.inner_clip.ImageHolder._width)*100; 
     } 
    } else { 
     if (content_clip.inner_clip.ImageHolder._width*(sc/100)>iw) { 
      sc = (iw/content_clip.inner_clip.ImageHolder._width)*100; 
     } 
    } 

오류 메시지는 다음과 같습니다

Scene 1, Layer 'Actions', Frame 10, Line 14, Column 11 1084: Syntax error: expecting rightparen before ne. 
Scene 1, Layer 'Actions', Frame 10, Line 26, Column 22 1084: Syntax error: expecting rightparen before and. 
Scene 1, Layer 'Actions', Frame 10, Line 26, Column 63 1084: Syntax error: expecting semicolon before rightparen. 
Scene 1, Layer 'Actions', Frame 10, Line 67, Column 37 1084: Syntax error: expecting rightparen before eq. 
Scene 1, Layer 'Actions', Frame 10, Line 69, Column 44 1084: Syntax error: expecting rightparen before eq. 
Scene 1, Layer 'Actions', Frame 10, Line 69, Column 93 1008: Attribute is invalid. 
Scene 1, Layer 'Actions', Frame 10, Line 69, Column 102 1084: Syntax error: expecting rightbrace before or. 
Scene 1, Layer 'Actions', Frame 10, Line 71, Column 4 1083: Syntax error: else is unexpected. 

는 방법이 위의 오류를 해결하기 위해 알 필요하십니까?

+0

내 대답이 표시된 8 개의 오류를 수정합니까? 수동으로 수정할 수있는 단어가 너무 많으면 단어 찾기 (찾기/바꾸기 도구)를 사용하여 해당 속성 ('ne','eq' 등)을 빠르게 바꿉니다. –

답변

1

코드 부분에 오류가있는 AS3 Operators을 조사하여 사용해야합니다. 예를 들어

, 당신의 코드는 다음에 매핑 할 것 같다

  • 귀하의 ne는 AS3 연산자에 해당 : !=를 (참조 : Not Equal을).

  • eq은 AS3 연산자 인 == (EQuality 참조)과 같습니다.

  • and은 AS3 연산자 인 && (AND 참조)과 같습니다.

  • or은 AS3 연산자 인 || (OR 참조)과 동일합니다.

    if (image ne undefined and image ne "" and image ne null) 
    

    정말이어야 (AS3) :

실시 예 1 : (AS2 코드)

if (image != undefined && image != "" && image != null) 


예 2 : (AS2 코드)

else if (controlBoxVAlign.toLowerCase() eq "middle" or controlBoxVAlign.toLowerCase() eq "center" or controlBoxVAlign.toLowerCase() eq "centre") { 

be (AS3) :

else if (controlBoxVAlign.toLowerCase() == "middle" || controlBoxVAlign.toLowerCase() == "center" ||controlBoxVAlign.toLowerCase() == "centre") {