Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Converting from actionscript 2 to actionscript 3

New Here ,
Oct 22, 2009 Oct 22, 2009

I found a program online thats sapoesed to do a lot of the converting for you and it did it converted more than 1000+ lines without any errors but not all of them... I am getting 2 errors in the code listed below and they are1084: Syntax error: expecting identifier before import.  this is on line 3 of the code below and 1084: Syntax error: expefcting rightbrace before function. this i on lines 7 and 8 of the code below.  i think there is a simple fix to these but cant figure out where to put the right brace and the identifier.  Any help is highly appreciated.

Marcus

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

package  {

if (_global.hasLoaded_XML == undefined)

import flash.display.MovieClip;

import flash.display.Stage;

{

    _global.hasLoaded_XML = true;

    Object.prototype.handleXML = public function (xmlNode, xmlPath, doneFunc)

    {

]

        xmlNode.ignoreWhite = true;

        xmlNode.onLoad = function (success)

        {

            addTier = function (currentPath)

            {

                for (var _loc2 in currentPath.attributes)

                {

                    currentPath[_loc2] = currentPath.attributes[_loc2];

                } // end of for...in

                for (var _loc2 in currentPath.childNodes)

                {

                    if (currentPath.childNodes[_loc2].childNodes.length >= 0)

                    {

                        addTier(currentPath.childNodes[_loc2]);

                    } // end if

                    currentPath[currentPath.childNodes[_loc2].nodeName + _loc2] = currentPath.childNodes[_loc2];

                    currentPath[currentPath.childNodes[_loc2].nodeName] = currentPath.childNodes[_loc2];

                } // end of for...in

            };

            addTier(xmlNode);

            doneFunc();

        };

        xmlNode.load(xmlPath);

    };

    Object.prototype.set_nodeText = public function (textPass)

    {

        return (textPass);

    };

    Object.prototype.get_nodeText = public function ()

    {

        return (this.firstChild.nodeValue);

    };

    Object.prototype.addProperty("nodeText", Object.prototype.get_nodeText, Object.prototype.set_nodeText);

    ASSetPropFlags(Object.prototype, ["get_nodeText", "set_nodeText", "nodeText"], 1);

} // end if

if (_global.hasLoaded_TWEENING == undefined)

{

    _global.hasLoaded_TWEENING = true;

    MovieClip.prototype.propTween = public function (id, propArray, valueArray, duration, method, nextStep, offset, nextParams)

    {

        var hasTripped = false;

        if (this.loopHolder == undefined)

        {

            this.createEmptyMovieClip("loopHolder", this.getTopDepth());

        } // end if

        if (method == undefined)

        {

            var method = "linearTween";

        } // end if

        if (this.loopHolder["loopCounter_" + id] != undefined)

        {

            this.loopHolder["loopCounter_" + id].removeMovieClip();

        } // end if

        var _loc3 = this.loopHolder.createEmptyMovieClip("loopCounter_" + id, this.loopHolder.getTopDepth());

        if (offset != undefined)

        {

            _loc3.duration = Math.max(duration, duration + offset);

            if (offset < 0)

            {

                _loc3.rollBack = duration + offset;

            }

            else

            {

                _loc3.rollBack = 0;

            } // end else if

        }

        else

        {

            _loc3.duration = duration;

        } // end else if

        _loc3.count = 1;

        _loc3.onEnterFrame = function ()

        {

            if (this.count <= this.duration)

            {

                if (this.count <= duration)

                {

                    for (var _loc2 = 0; _loc2 < propArray.length; ++_loc2)

                    {

                        if (this[b + "_" + propArray[_loc2]] == undefined || this.count == 1)

                        {

                            this[b + "_" + propArray[_loc2]] = this.parent.parent[propArray[_loc2]];

                        } // end if

                        this.parent.parent[propArray[_loc2]] = Penner[method](this.count, this[b + "_" + propArray[_loc2]], valueArray[_loc2], duration);

                        if (propArray[_loc2] == "scaleX" || propArray[_loc2] == "scaleY")

                        {

                            if (this.parent.parent[propArray[_loc2]] == 0 && this.parent.parent.visible == true)

                            {

                                this.parent.parent.visible = false;

                            } // end if

                            if (this.parent.parent[propArray[_loc2]] != 0 && this.parent.parent.visible != true)

                            {

                                this.parent.parent.visible = true;

                            } // end if

                        } // end if

                    } // end of for

                } // end if

                if (this.rollBack == this.count && nextStep != undefined)

                {

                    nextStep(nextParams);

                    hasTripped = true;

                } // end if

                ++this.count;

            }

            else

            {

                this.removeMovieClip();

                if (nextStep != undefined && hasTripped != true)

                {

                    nextStep(nextParams);

                } // end if

            } // end else if

        };

    };

    MovieClip.prototype.killTweens = public function ()

    {

        this.loopHolder.removeMovieClip();

    };

    MovieClip.prototype.tweenScale = public function (xscale, yscale, duration, method, nextStep, offset, nextParams)

    {

        var _loc2 = "Scale";

        var _loc4 = ["scaleX", "scaleY"];

        var _loc3 = [xscale - this.scaleX, yscale - this.scaleY];

        this.propTween(_loc2, _loc4, _loc3, duration, method, nextStep, offset, nextParams);

    };

    MovieClip.prototype.tweenPosition = public function (xVar, yVar, duration, method, nextStep, offset, nextParams)

    {

        var _loc2 = "Position";

        var _loc4 = ["x", "y"];

        var _loc3 = [xVar - this.x, yVar - this.y];

        this.propTween(_loc2, _loc4, _loc3, duration, method, nextStep, offset, nextParams);

    };

    MovieClip.prototype.tweenRotation = public function (rotation, duration, method, nextStep, offset, nextParams)

    {

        var _loc2 = "Rotation";

        var _loc4 = ["rotation"];

        var _loc3 = [rotation];

        this.propTween(_loc2, _loc4, _loc3, duration, method, nextStep, offset, nextParams);

    };

    MovieClip.prototype.tweenAlpha = public function (alpha, duration, method, nextStep, offset, nextParams)

    {

        var _loc2 = "Alpha";

        var _loc4 = ["alpha"];

        var _loc3 = [alpha - this.alpha];

        this.propTween(_loc2, _loc4, _loc3, duration, method, nextStep, offset, nextParams);

    };

    MovieClip.prototype.tweenSize = public function (width, height, duration, method, nextStep, offset, nextParams)

    {

        var _loc2 = "Size";

        var _loc4 = ["width", "height"];

        var _loc3 = [width - this.width, height - this.height];

        this.propTween(_loc2, _loc4, _loc3, duration, method, nextStep, offset, nextParams);

    };

    MovieClip.prototype.tweenTint = public function (rtint, gtint, btint, duration, method, nextStep, offset, nextParams)

    {

        var _loc2 = "RGB";

        var _loc4 = ["_rtint", "_gtint", "_btint"];

        var _loc3 = [rtint - this._rtint, gtint - this._gtint, btint - this._btint];

        this.propTween(_loc2, _loc4, _loc3, duration, method, nextStep, offset, nextParams);

    };

} // end if

if (_global.hasLoaded_TMATH == undefined)

{

    _global.hasLoaded_TMATH = true;

    _global.ranNum = public function (low, high)

    {

        return (Math.round(Math.random() * (high - low)) + low);

    };

} // end if

if (_global.hasLoaded_PENNER == undefined)

{

    _global.hasLoaded_PENNER = true;

    _global.Penner = {};

    ASSetPropFlags(_global, "Penner", 1, true);

    Penner.linearTween = public function (t, b, c, d)

    {

        return (c * t / d + b);

    };

    Penner.easeInQuad = public function (t, b, c, d)

    {

        t = t / d;

        return (c * (t) * t + b);

    };

    Penner.easeOutQuad = public function (t, b, c, d)

    {

        t = t / d;

        return (-c * (t) * (t - 2) + b);

    };

    Penner.easeInOutQuad = public function (t, b, c, d)

    {

        t = t / (d / 2);

        if (t < 1)

        {

            return (c / 2 * t * t + b);

        } // end if

        return (-c / 2 * (--t * (t - 2) - 1) + b);

    };

    Penner.easeInCubic = public function (t, b, c, d)

    {

        t = t / d;

        return (c * (t) * t * t + b);

    };

    Penner.easeOutCubic = public function (t, b, c, d)

    {

        t = t / d - 1;

        return (c * ((t) * t * t + 1) + b);

    };

    Penner.easeInOutCubic = public function (t, b, c, d)

    {

        t = t / (d / 2);

        if (t < 1)

        {

            return (c / 2 * t * t * t + b);

        } // end if

        t = t - 2;

        return (c / 2 * ((t) * t * t + 2) + b);

    };

    Penner.easeInQuart = public function (t, b, c, d)

    {

        t = t / d;

        return (c * (t) * t * t * t + b);

    };

    Penner.easeOutQuart = public function (t, b, c, d)

    {

        t = t / d - 1;

        return (-c * ((t) * t * t * t - 1) + b);

    };

    Penner.easeInOutQuart = public function (t, b, c, d)

    {

        t = t / (d / 2);

        if (t < 1)

        {

            return (c / 2 * t * t * t * t + b);

        } // end if

        t = t - 2;

        return (-c / 2 * ((t) * t * t * t - 2) + b);

    };

    Penner.easeInQuint = public function (t, b, c, d)

    {

        t = t / d;

        return (c * (t) * t * t * t * t + b);

    };

    Penner.easeOutQuint = public function (t, b, c, d)

    {

        t = t / d - 1;

        return (c * ((t) * t * t * t * t + 1) + b);

    };

    Penner.easeInOutQuint = public function (t, b, c, d)

    {

        t = t / (d / 2);

        if (t < 1)

        {

            return (c / 2 * t * t * t * t * t + b);

        } // end if

        t = t - 2;

        return (c / 2 * ((t) * t * t * t * t + 2) + b);

    };

    Penner.easeInSine = public function (t, b, c, d)

    {

        return (-c * Math.cos(t / d * 1.570796E+000) + c + b);

    };

    Penner.easeOutSine = public function (t, b, c, d)

    {

        return (c * Math.sin(t / d * 1.570796E+000) + b);

    };

    Penner.easeInOutSine = public function (t, b, c, d)

    {

        return (-c / 2 * (Math.cos(3.141593E+000 * t / d) - 1) + b);

    };

    Penner.easeInExpo = public function (t, b, c, d)

    {

        return (t == 0 ? (b) : (c * Math.pow(2, 10 * (t / d - 1)) + b));

    };

    Penner.easeOutExpo = public function (t, b, c, d)

    {

        return (t == d ? (b + c) : (c * (-Math.pow(2, -10 * t / d) + 1) + b));

    };

    Penner.easeInOutExpo = public function (t, b, c, d)

    {

        if (t == 0)

        {

            return (b);

        } // end if

        if (t == d)

        {

            return (b + c);

        } // end if

        t = t / (d / 2);

        if (t < 1)

        {

            return (c / 2 * Math.pow(2, 10 * (t - 1)) + b);

        } // end if

        return (c / 2 * (-Math.pow(2, -10 * --t) + 2) + b);

    };

    Penner.easeInCirc = public function (t, b, c, d)

    {

        t = t / d;

        return (-c * (Math.sqrt(1 - t * t) - 1) + b);

    };

    Penner.easeOutCirc = public function (t, b, c, d)

    {

        t = t / d - 1;

        return (c * Math.sqrt(1 - (t) * t) + b);

    };

    Penner.easeInOutCirc = public function (t, b, c, d)

    {

        t = t / (d / 2);

        if (t < 1)

        {

            return (-c / 2 * (Math.sqrt(1 - t * t) - 1) + b);

        } // end if

        t = t - 2;

        return (c / 2 * (Math.sqrt(1 - (t) * t) + 1) + b);

    };

    Penner.easeInElastic = public function (t, b, c, d, a, p)

    {

        if (t == 0)

        {

            return (b);

        } // end if

        t = t / d;

        if (t == 1)

        {

            return (b + c);

        } // end if

        if (!p)

        {

            p = d * 3.000000E-001;

        } // end if

        if (!a)

        {

            a = 0;

        } // end if

        if (a < Math.abs(c))

        {

            a = c;

            var _loc7 = p / 4;

        }

        else

        {

            _loc7 = p / 6.283185E+000 * Math.asin(c / a);

        } // end else if

        t = t - 1;

        return (-a * Math.pow(2, 10 * (t)) * Math.sin((t * d - _loc7) * 6.283185E+000 / p) + b);

    };

    Penner.easeOutElastic = public function (t, b, c, d, a, p)

    {

        if (t == 0)

        {

            return (b);

        } // end if

        t = t / d;

        if (t == 1)

        {

            return (b + c);

        } // end if

        if (!p)

        {

            p = d * 3.000000E-001;

        } // end if

        if (!a)

        {

            a = 0;

        } // end if

        if (a < Math.abs(c))

        {

            a = c;

            var _loc7 = p / 4;

        }

        else

        {

            _loc7 = p / 6.283185E+000 * Math.asin(c / a);

        } // end else if

        return (a * Math.pow(2, -10 * t) * Math.sin((t * d - _loc7) * 6.283185E+000 / p) + c + b);

    };

    Penner.easeInOutElastic = public function (t, b, c, d, a, p)

    {

        if (t == 0)

        {

            return (b);

        } // end if

        t = t / (d / 2);

        if (t == 2)

        {

            return (b + c);

        } // end if

        if (!p)

        {

            p = d * 4.500000E-001;

        } // end if

        if (!a)

        {

            a = 0;

        } // end if

        if (a < Math.abs(c))

        {

            a = c;

            var _loc7 = p / 4;

        }

        else

        {

            _loc7 = p / 6.283185E+000 * Math.asin(c / a);

        } // end else if

        if (t < 1)

        {

            t = t - 1;

            return (-5.000000E-001 * (a * Math.pow(2, 10 * (t)) * Math.sin((t * d - _loc7) * 6.283185E+000 / p)) + b);

        } // end if

        t = t - 1;

        return (a * Math.pow(2, -10 * (t)) * Math.sin((t * d - _loc7) * 6.283185E+000 / p) * 5.000000E-001 + c + b);

    };

    Penner.easeInBack = public function (t, b, c, d, s)

    {

        if (s == undefined)

        {

            s = 1.701580E+000;

        } // end if

        t = t / d;

        return (c * (t) * t * ((s + 1) * t - s) + b);

    };

    Penner.easeOutBack = public function (t, b, c, d, s)

    {

        if (s == undefined)

        {

            s = 1.701580E+000;

        } // end if

        t = t / d - 1;

        return (c * ((t) * t * ((s + 1) * t + s) + 1) + b);

    };

    Penner.easeInOutBack = public function (t, b, c, d, s)

    {

        if (s == undefined)

        {

            s = 1.701580E+000;

        } // end if

        t = t / (d / 2);

        if (t < 1)

        {

            s = s * 1.525000E+000;

            return (c / 2 * (t * t * ((s + 1) * t - s)) + b);

        } // end if

        t = t - 2;

        s = s * 1.525000E+000;

        return (c / 2 * ((t) * t * ((s + 1) * t + s) + 2) + b);

    };

    Penner.easeInBounce = public function (t, b, c, d)

    {

        return (c - Penner.easeOutBounce(d - t, 0, c, d) + b);

    };

    Penner.easeOutBounce = public function (t, b, c, d)

    {

        t = t / d;

        if (t < 3.636364E-001)

        {

            return (c * (7.562500E+000 * t * t) + b);

        }

        else if (t < 7.272727E-001)

        {

            t = t - 5.454545E-001;

            return (c * (7.562500E+000 * (t) * t + 7.500000E-001) + b);

        }

        else if (t < 9.090909E-001)

        {

            t = t - 8.181818E-001;

            return (c * (7.562500E+000 * (t) * t + 9.375000E-001) + b);

        }

        else

        {

            t = t - 9.545455E-001;

            return (c * (7.562500E+000 * (t) * t + 9.843750E-001) + b);

        } // end else if

    };

    Penner.easeInOutBounce = public function (t, b, c, d)

    {

        if (t < d / 2)

        {

            return (Penner.easeInBounce(t * 2, 0, c, d) * 5.000000E-001 + b);

        } // end if

        return (Penner.easeOutBounce(t * 2 - d, 0, c, d) * 5.000000E-001 + c * 5.000000E-001 + b);

    };

} // end if

if (_global.hasLoaded_COLOR == undefined)

{

    _global.hasLoaded_COLOR = true;

    MovieClip.prototype.apply_rtint = public function (value)

    {

        var _loc2 = new Color(this);

        var _loc3 = {rb: value};

        _loc2.setTransform(_loc3);

    };

    MovieClip.prototype.fetch_rtint = public function ()

    {

        var _loc2 = new Color(this);

        return (_loc2.getTransform().rb);

    };

    MovieClip.prototype.addProperty("_rtint", MovieClip.prototype.fetch_rtint, MovieClip.prototype.apply_rtint);

    ASSetPropFlags(MovieClip.prototype, ["apply_rtint", "fetch_rtint", "_rtint"], 1);

    MovieClip.prototype.apply_gtint = public function (value)

    {

        var _loc2 = new Color(this);

        var _loc3 = {gb: value};

        _loc2.setTransform(_loc3);

    };

    MovieClip.prototype.fetch_gtint = public function ()

    {

        var _loc2 = new Color(this);

        return (_loc2.getTransform().gb);

    };

    MovieClip.prototype.addProperty("_gtint", MovieClip.prototype.fetch_gtint, MovieClip.prototype.apply_gtint);

    ASSetPropFlags(MovieClip.prototype, ["apply_gtint", "fetch_gtint", "_gtint"], 1);

    MovieClip.prototype.apply_btint = public function (value)

    {

        var _loc2 = new Color(this);

        var _loc3 = {bb: value};

        _loc2.setTransform(_loc3);

    };

    MovieClip.prototype.fetch_btint = public function ()

    {

        var _loc2 = new Color(this);

        return (_loc2.getTransform().bb);

    };

    MovieClip.prototype.addProperty("_btint", MovieClip.prototype.fetch_btint, MovieClip.prototype.apply_btint);

    ASSetPropFlags(MovieClip.prototype, ["apply_btint", "fetch_btint", "_btint"], 1);

} // end if

if (_global.hasLoaded_DEPTHS == undefined)

{

    _global.hasLoaded_DEPTHS = true;

    MovieClip.prototype.getTopDepth = public function ()

    {

        var _loc3 = 0;

        for (var _loc4 in this)

        {

            var _loc2 = this[_loc4];

            if (_loc2.getDepth() != undefined && _loc2.getDepth() > _loc3)

            {

                _loc3 = _loc2.getDepth();

            } // end if

        } // end of for...in

        return (_loc3 + 1);

    };

} // end if

var tick = 0;

var transMethod = "easeInOutExpo";

var openClip = null;

_global.selectProject = function (whichClip)

{

    if (!whichClip.isOpen)

    {

        lockMovie();

        selectedProject = whichClip;

        panelOpen = true;

        closeProject(openClip);

        openClip = whichClip;

        whichClip.isOpen = true;

        whichClip.fetchContent();

        dropMe(whichClip);

    } // end if

};

_global.deselectProject = function (whichClip)

{

    delete selectedProject;

    unlockMovie();

    panelOpen = false;

    closeProject(whichClip);

    whichClip.setRollOvers();

};

_global.closeProject = function (whichClip)

{

    whichClip.dropContent();

    if (whichClip.isOpen)

    {

        whichClip.isOpen = false;

        dropMe();

    } // end if

};

dropMe = function (whichClip)

{

    if (!whichClip)

    {

        deselectProject(selectedProject);

    } // end if

    public var _loc7 = [];

    public var _loc5 = 0;

    for (public var _loc2 = 0; _loc2 < projectArray.length; ++_loc2)

    {

        var _loc4 = projectArray[_loc2].dataObject.category;

        if (projectArray[_loc2] != whichClip)

        {

            if (_global["filter_" + _loc4] == true)

            {

                _loc7.push(projectArray[_loc2]);

                projectArray[_loc2].isOpen = false;

                projectArray[_loc2].isOut = false;

                continue;

            } // end if

            if (!projectArray[_loc2].isOut)

            {

                _loc5 = _loc5 + 2;

                var _loc3 = 10 + _loc5;

                projectArray[_loc2].isOut = true;

                projectArray[_loc2].tweenScale(0, 0, _loc3, "easeInOutExpo");

                projectArray[_loc2].tweenPosition(0, 0, _loc3, "easeInOutExpo");

            } // end if

        } // end if

    } // end of for

    orderArray = _loc7;

    false;

    whichClip.tweenPosition(0, 0, 20, transMethod);

    whichClip.tweenScale(100, 100, 20, transMethod);

    whichClip.tweenAlpha(100, 20, transMethod);

    root["alignObjects_" + currentMode]();

};

_global.hideAll = function ()

{

    for (public var _loc1 = 0; _loc1 < projectArray.length; ++_loc1)

    {

        projectArray[_loc1].tweenTint(-150, -150, -150, 10);

    } // end of for

    displayPlane.tweenTint(-30, -30, -30, 10);

};

_global.showAll = function ()

{

    for (public var _loc1 = 0; _loc1 < projectArray.length; ++_loc1)

    {

        1;

        projectArray[_loc1].tweenTint(0, 0, 0, 10);

    } // end of for

    displayPlane.tweenTint(0, 0, 0, 10);

};

alignObjects_horizontal = function ()

{

    delete displayPlane.onEnterFrame;

    public var range = 0;

    setPos = public function (jump)

    {

        for (var _loc2 = 0; _loc2 < orderArray.length; ++_loc2)

        {

            var _loc1 = orderArray[_loc2];

            var _loc8 = orderArray[_loc2 - 1];

            if (_loc2 == 0)

            {

                range = range - (range - (displayPlane.width + 80 - stage.stageWidth)) * 1.000000E-001;

                var _loc7 = range / stage.stageWidth;

                var _loc9 = _loc1.x - (_loc1.x - (80 - stage.stageWidth / 2 + -mouseX * _loc7)) * 1.000000E-001;

            }

            else

            {

                _loc9 = _loc8.x + _loc8.width / 2 + _loc1.width / 2 + 10;

            } // end else if

            var _loc4 = 0;

            var _loc11 = Math.sqrt(Math.pow(displayPlane.mouseX - _loc1.x, 2) + Math.pow(displayPlane.mouseY - _loc1.y, 2)) / 4;

            if (Math.abs(displayPlane.mouseY) < 80 && !navOpen)

            {

                var _loc10 = 150 - Math.max(0, Math.min(100, _loc11));

                if (_loc2 == 0)

                {

                    _loc9 = _loc1.x - (_loc1.x - (100 - stage.stageWidth / 2 + -mouseX * _loc7)) * 1.000000E-001;

                } // end if

            }

            else

            {

                _loc10 = _loc1.scaleX - (_loc1.scaleX - 100) * 2.000000E-001;

                _loc9 = _loc1.x - (_loc1.x - (-orderArray.length * 120 / 2 + _loc2 * 120)) * 2.000000E-001;

            } // end else if

            var _loc5 = _loc1.scaleX - (_loc1.scaleX - _loc10) * 3.000000E-001;

            var _loc6 = 100;

            if (jump)

            {

                _loc1.y = _loc4;

                _loc1.x = _loc1.x - (_loc1.x - _loc9) * 9.000000E-001;

                _loc1.scaleX = _loc1.scaleY = _loc5;

                _loc1.alpha = _loc6;

                continue;

            } // end if

            if (panelOpen)

            {

                _loc5 = 0;

            }

            else

            {

                _loc5 = 100;

            } // end else if

            _loc9 = -orderArray.length * 120 / 2 + _loc2 * 120;

            var _loc3 = 5 + _loc2;

            if (_loc2 == orderArray.length - 1)

            {

                _loc1.tweenPosition(_loc9, _loc4, _loc3, transMethod, setMotion);

            }

            else

            {

                _loc1.tweenPosition(_loc9, _loc4, _loc3, transMethod);

            } // end else if

            _loc1.tweenScale(_loc5, _loc5, _loc3, transMethod);

            _loc1.tweenAlpha(_loc6, _loc3, transMethod);

        } // end of for

    };

    setMotion = public function ()

    {

        if (panelOpen != true)

        {

            displayPlane.onEnterFrame = function ()

            {

                setPos(true);

            };

        } // end if

    };

    setPos();

};

_global.root = this;

if (_root.swfRoot)

{

    _global.swfRoot = _root.swfRoot;

}

else

{

    _global.swfRoot = "";

} // end else if

setProperty("", _quality, "BEST");

var stageListener = new Object();

stageListener.onResize = function ()

{

    layoutScreen();

};

Stage.addListener(stageListener);

layoutScreen = function ()

{

    navBar.x = Math.round((stage.stageWidth - 1072) / 2);

    navBar.y = Math.round((stage.stageHeight + 600) / 2);

displayPlane.BG.width = displayPlane.slug.width = stage.stageWidth;

    displayPlane.BG.height = displayPlane.slug.height = stage.stageHeight;

navBar.mainNav.grabber.x = stage.stageWidth/2;

    navBar.mainNav.BG.height = 30;

navBar.mainNav.BG.width = stage.stageWidth/2;

};

beginMovie = function ()

{

    populatePanel();

    createObjects();

    layoutScreen();

    displayPlane.tweenAlpha(100, 10);

};

populatePanel = function ()

{

    createInterfaces();

createBackgrounds();

    createFilters();

};

createInterfaces = function ()

{

    _global.interfaceArray = [];

    public var _loc5 = interfaceNode.data0;

    public var _loc6 = navBar.mainNav.attachMovie("interfacePanel", "interfacePanel_1", 0);

navBar.mainNav.BG.x

    _loc6.y = 1;

    _loc6.x = 1;

    for (public var _loc4 = 0; _loc4 < _loc5.childNodes.length; ++_loc4)

    {

        var thisObject = _loc5["interface" + _loc4];

        var _loc3 = _loc6.attachMovie("navClip", "navClip" + _loc4, _loc4);

        _loc3.thisObject = thisObject;

        interfaceArray.push(thisObject);

        _loc3.x = _loc4 * 150+ 1;

        _loc3.textClip.displayText.text = thisObject.title.toUpperCase();

        _loc3.textClip.displayText.autoSize = true;

        _loc3.onRollOver = function ()

        {

            this.gotoAndPlay("in");

        };

        _loc3.onRollOut = function ()

        {

            this.gotoAndPlay("out");

        };

        _loc3.onPress = function ()

        {

            _global.currentMode = this.thisObject.id;

            dropMe();

            root["alignObjects_" + this.thisObject.id]();

            setInterfaceRollovers(currentMode);

        };

    } // end of for

    _global.currentMode = interfaceArray[ranNum(0, interfaceArray.length - 1)].id;

    setInterfaceRollovers(currentMode);

};

setInterfaceRollovers = function (id)

{

    public var _loc4 = interfaceNode.data0;

    public var _loc3 = navBar.mainNav.interfacePanel_1;

    for (public var _loc1 = 0; _loc1 < _loc4.childNodes.length; ++_loc1)

    {

        var _loc2 = _loc3["navClip" + _loc1];

        if (id == _loc2.thisObject.id)

        {

            _loc2.toggleClip.gotoAndStop(1);

            continue;

        } // end if

        _loc2.toggleClip.gotoAndStop(2);

    } // end of for

};

createBackgrounds = function ()

{

    _global.backgroundArray = [];

    public var _loc5 = backgroundNode.data0;

    public var _loc6 = navBar.mainNav.attachMovie("interfacePanel", "interfacePanel_2", 1);

    _loc6.y = navBar.mainNav.interfacePanel_1.height + 50;

    _loc6.x = 1;

    for (public var _loc4 = 0; _loc4 < _loc5.childNodes.length; ++_loc4)

    {

        var thisObject = _loc5["interface" + _loc4];

        var _loc3 = _loc6.attachMovie("navClip", "navClip" + _loc4, _loc4);

        _loc3.thisObject = thisObject;

        backgroundArray.push(thisObject);

        _loc3.y = _loc4 * 23 + 34;

        _loc3.textClip.displayText.text = thisObject.title.toUpperCase();

        _loc3.textClip.displayText.autoSize = true;

        _loc3.onRollOver = function ()

        {

            this.gotoAndPlay("in");

        };

        _loc3.onRollOut = function ()

        {

            this.gotoAndPlay("out");

        };

        _loc3.onPress = function ()

        {

            changeBG(this.thisObject.path);

        };

    } // end of for

    changeBG(backgroundArray[ranNum(0, backgroundArray.length - 1)].path);

};

setBGRollovers = function (path)

{

    public var _loc4 = backgroundNode.data0;

    public var _loc3 = navBar.mainNav.interfacePanel_2;

    for (public var _loc1 = 0; _loc1 < _loc4.childNodes.length; ++_loc1)

    {

        var _loc2 = _loc3["navClip" + _loc1];

        if (path == _loc2.thisObject.path)

        {

            _loc2.toggleClip.gotoAndStop(1);

            continue;

        } // end if

        _loc2.toggleClip.gotoAndStop(2);

    } // end of for

};

changeBG = function (path)

{

    setBGRollovers(path);

    public var imageHolder = displayPlane.BG.createEmptyMovieClip("imageHolder", 0);

    if (path)

    {

        imageHolder.alpha = 0;

        imageHolder.loadMovie(swfRoot + path);

        displayPlane.BG.onEnterFrame = function ()

        {

            if (imageHolder.getBytesLoaded() == imageHolder.getBytesTotal() && imageHolder.getBytesTotal() > 10)

            {

                imageHolder.x = -imageHolder.width / 2;

                imageHolder.y = -imageHolder.height / 2;

                imageHolder.tweenAlpha(100, 10);

                delete this.onEnterFrame;

            } // end if

        };

    } // end if

};

createFilters = function ()

{

    public var _loc6 = projectsNode.data0;

    for (public var _loc4 = 0; _loc4 < _loc6.projects.childNodes.length; ++_loc4)

    {

        var _loc5 = _loc6.projects["category" + _loc4];

        _global["filter_" + _loc5.type] = true;

    } // end of for

};

createObjects = function ()

{

    _global.projectCount = 0;

    _global.projectArray = [];

    public var _loc8 = projectsNode.data0;

    for (public var _loc7 = 0; _loc7 < _loc8.projects.childNodes.length; ++_loc7)

    {

        var _loc5 = _loc8.projects["category" + _loc7];

        for (var _loc4 = 0; _loc4 < _loc5.childNodes.length; ++_loc4)

        {

            var _loc6 = _loc5["project" + _loc4];

            _loc6.category = _loc5.type;

            var _loc3 = displayPlane.attachMovie("displayNode", "displayNode_" + projectCount, projectCount);

            _loc3.scaleX = _loc3.scaleY = 0;

            _loc3.dataObject = _loc6;

            projectArray.push(_loc3);

            ++projectCount;

        } // end of for

    } // end of for

    _global.orderArray = projectArray;

    public var _loc9 = displayPlane.attachMovie("slug", "slug", projectCount);

    _loc9.visible = false;

    _loc9.onRollOver = public function ()

    {

    };

    _loc9.useHandCursor = false;

    displayPlane.createEmptyMovieClip("topClip", projectCount + 1);

    displayPlane.createEmptyMovieClip("topClip2", projectCount + 2);

    this["alignObjects_" + currentMode]();

};

_global.bumpToTopLevel = function (whichClip)

{

    if (whichClip.getDepth() < displayPlane.topClip.getDepth())

    {

        displayPlane.topClip.swapDepths(whichClip);

    } // end if

};

_global.bumpToOrgLevel = function (whichClip)

{

    if (whichClip.getDepth() > displayPlane.topClip.getDepth())

    {

        displayPlane.topClip.swapDepths(whichClip);

    } // end if

};

_global.bumpToTopLevel2 = function (whichClip)

{

    if (whichClip.getDepth() < displayPlane.topClip2.getDepth())

    {

        displayPlane.topClip2.swapDepths(whichClip);

    } // end if

};

_global.bumpToOrgLevel2 = function (whichClip)

{

    if (whichClip.getDepth() > displayPlane.topClip2.getDepth())

    {

        displayPlane.topClip2.swapDepths(whichClip);

    } // end if

};

_global.lockMovie = function ()

{

    displayPlane.slug.visible = true;

};

_global.unlockMovie = function ()

{

    displayPlane.slug.visible = false;

};

_global.setTag = function (textPass)

{

    nameTag.displayText.text = textPass.toUpperCase();

    nameTag.displayText.autoSize = true;

    nameTag.BG.width = nameTag.displayText.width + 20;

    nameTag.BG.height = nameTag.displayText.height + 6;

    nameTag.displayText.x = -Math.round(nameTag.displayText.width / 2);

    nameTag.displayText.y = -Math.round(nameTag.displayText.height / 2) + 1;

    public var X = Math.round(nameTag.displayText.width / 2) + 30;

    public var Y = Math.round(nameTag.displayText.height / 2) + 30;

    if (nameTag.visible != true)

    {

        nameTag.visible = true;

        if (mouseX > 500)

        {

            var hTag = "left";

            nameTag.x = mouseX - X;

        }

        else

        {

            var hTag = "right";

            nameTag.x = mouseX + X;

        } // end else if

        if (mouseY > 100)

        {

            var vTag = "bottom";

            nameTag.y = mouseY - Y;

        }

        else

        {

            var vTag = "top";

            nameTag.y = mouseY - Y;

        } // end else if

        nameTag.y = mouseY;

        nameTag.onEnterFrame = function ()

        {

            if (hTag == "left")

            {

                var _loc4 = _root.mouseX - (this.x + X);

            }

            else

            {

                _loc4 = _root.mouseX - (this.x - X);

            } // end else if

            if (vTag == "bottom")

            {

                var _loc3 = _root.mouseY - (this.y + Y);

            }

            else

            {

                _loc3 = _root.mouseY - (this.y - Y);

            } // end else if

            this.x = Math.round(this.x + _loc4 * 1.000000E-001);

            this.y = Math.round(this.y + _loc3 * 1.000000E-001);

        };

    } // end if

};

_global.killTag = function ()

{

    _root.nameTag.visible = false;

    delete _root.nameTag.onEnterFrame();

};

}

TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 22, 2009 Oct 22, 2009

My guess is that you are seeing just the tip of the iceberg for the errors in that code.  Just glancing thru it all the way down I see a variety of AS2 code that will not get passed the compiler as soon as it becomes their turn to be noticed.  Unfortunately, AS3 error catching is often a gradual disclosure deal, not everything that's wrong is reported all at once.  You get rid of x errors and y more errors show up, you get rid of y errors z errors show up... etc...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 22, 2009 Oct 22, 2009

First off i would like to thank you for your reply!  Second i am new to adobe flash and actionscript so let me explain to you what i trying to do.  I downloaded a horizontal button menu and a photo slideshow made in flash and i have been trying to get them both to work in the same file.  They both have xml's that i edited with my own stuff.  Everything for the current web page i am createing right now is done its just getting them all together.  I think the buttons that i downloaded are in as2 and im trying to get them into as3 with the slideshow.  I am not 100% sure the buttons are as2 or not but i know when i import the slide show and change the setting in the publish settings to as3 the buttons dont show up but as long as its in as2 they will show up.  Is there any easy way around this?

Thanks!

Marcus

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2010 May 11, 2010
LATEST

Make your own buttons, never try to convert from AS2 to AS3 especially with some useless converter. You will save hours by making your own in AS3. OR at least download them in AS3, I am sure many better buttons exist that serve your purposes in AS3 than AS2.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines