mardi 7 novembre 2017

How can I use script 2 to action script 3 by changing Image loading with preloader, Initial settings, alignment?

I have used action script 2 for flash files but since the action script 2 doesn't support by any browser, I need to change my action script 2 code to action script 3. While I was trying to convert using adobe animate, it started to show some errors in image loading with preloader, initial settings, vertical/ horizontal alignment and so on. The code and the error messages are given below:

//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;
        }
    }

The error messages are: 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.

Need to know how to fix those problems

Aucun commentaire:

Enregistrer un commentaire