Comunidad de diseño web y desarrollo en internet online

Ayudenme a entender este codigo

Citar            
MensajeEscrito el 20 Feb 2011 11:12 pm

Código ActionScript :

_root.sec = 1;
_root.RO = function (path)
{
    _root.ro.gotoAndPlay("over");
    ++_root.sec;
    _root["TweenR2" + _root.sec].stop();
    _root["TweenX2" + _root.sec].stop();
    _root["TweenY2" + _root.sec].stop();
    _root["TweenRO" + _root.sec] = new mx.transitions.Tween(path.pic, "_alpha", mx.transitions.easing.Regular.easeOut, path.pic._alpha, 80, 5.000000E-001, true);
    _root["TweenX" + _root.sec] = new mx.transitions.Tween(path, "_xscale", mx.transitions.easing.Elastic.easeOut, path._xscale, 105, 5.000000E-001, true);
    _root["TweenY" + _root.sec] = new mx.transitions.Tween(path, "_yscale", mx.transitions.easing.Elastic.easeOut, path._yscale, 105, 5.000000E-001, true);
};
_root.ROut = function (path2)
{
    _root.ro.gotoAndPlay("out");
    _root["TweenR" + _root.sec].stop();
    _root["TweenX" + _root.sec].stop();
    _root["TweenY" + _root.sec].stop();
    _root["TweenR2" + _root.sec] = new mx.transitions.Tween(path2.pic, "_alpha", mx.transitions.easing.Regular.easeOut, path2.pic._alpha, 100, 5.000000E-001, true);
    _root["TweenX2" + _root.sec] = new mx.transitions.Tween(path2, "_xscale", mx.transitions.easing.Back.easeInOut, path2._xscale, 100, 5.000000E-001, true);
    _root["TweenY2" + _root.sec] = new mx.transitions.Tween(path2, "_yscale", mx.transitions.easing.Back.easeInOut, path2._yscale, 100, 5.000000E-001, true);
};
_root.Cont = 0;
_root.ContPos = new Array();
_root.mov = 0;
_root.anim = 1;
var scaleBtnStartX = 82;
var scaleBtnStartY = 82;
var scaleBtnEndX = 100;
var scaleBtnEndY = 100;
var btnStartY = 280;
var btnEndY = 320;
var btnActStartX = -76;
_root.arrayMcX = new Array();
var deltaMoveX = 20;
var flagGallery = true;
var countMenuBtns = 4;
for (i = 1; i <= countMenuBtns; i++)
{
    var item = this["im" + i];
    item.p = i;
    item._alpha = 0;
    item.mc1.gotoAndStop(i);
    item.mc2.gotoAndStop(i);
    item.txtIm.gotoAndStop(i);
    item.index = i;
    item.area.index = item.index;
    _root.arrayMcX[i] = item._x;
    item.area.onRollOver = function ()
    {
        if (link != this.index && _root.Cont != 1)
        {
            btnName = _root["im" + this.index];
            btnName.gotoAndPlay("over");
            tweenXScale.stop();
            tweenYScale.stop();
            tweenBtnY.stop();
            var tweenXScale = new mx.transitions.Tween(btnName, "_xscale", mx.transitions.easing.Strong.easeOut, btnName._xscale, scaleBtnEndX, 4.000000E-001, true);
            var tweenYScale = new mx.transitions.Tween(btnName, "_yscale", mx.transitions.easing.Strong.easeOut, btnName._yscale, scaleBtnEndY, 4.000000E-001, true);
            var tweenBtnY = new mx.transitions.Tween(btnName, "_y", mx.transitions.easing.Strong.easeOut, btnName._y, btnEndY, 4.000000E-001, true);
            tweenLastX2.stop();
            tweenLastX1.stop();
            for (i = this.index + 1; i <= countMenuBtns; i++)
            {
                var _loc4 = _root["im" + i];
                var tweenLastX2 = new mx.transitions.Tween(_loc4, "_x", mx.transitions.easing.Regular.easeOut, _loc4._x, arrayMcX[i] + deltaMoveX, 6.000000E-001, true);
            } // end of for
            for (i = 1; i < this.index; i++)
            {
                var _loc3 = _root["im" + i];
                var tweenLastX1 = new mx.transitions.Tween(_loc3, "_x", mx.transitions.easing.Regular.easeOut, _loc3._x, arrayMcX[i] - deltaMoveX, 6.000000E-001, true);
            } // end of for
        } // end if
    };
    item.area.onRollOut = item.area.onReleaseOutside = function ()
    {
        if (link != this.index && _root.Cont != 1)
        {
            btnName = _root["im" + this.index];
            btnName.gotoAndPlay("out");
            tweenXScale.stop();
            tweenYScale.stop();
            tweenBtnY.stop();
            var tweenXScale = new mx.transitions.Tween(btnName, "_xscale", mx.transitions.easing.Regular.easeOut, btnName._xscale, scaleBtnStartX, 4.000000E-001, true);
            var tweenYScale = new mx.transitions.Tween(btnName, "_yscale", mx.transitions.easing.Regular.easeOut, btnName._yscale, scaleBtnStartY, 4.000000E-001, true);
            var tweenBtnY = new mx.transitions.Tween(btnName, "_y", mx.transitions.easing.Regular.easeOut, btnName._y, btnStartY, 4.000000E-001, true);
            tweenLastX2.stop();
            tweenLastX1.stop();
            tweenLastAlpha1.stop();
            tweenLastAlpha2.stop();
            tweenLastAlpha1_2.stop();
            tweenLastAlpha2_2.stop();
            for (i = this.index + 1; i <= countMenuBtns; i++)
            {
                var _loc4 = _root["im" + i];
                var tweenLastX2 = new mx.transitions.Tween(_loc4, "_x", mx.transitions.easing.Regular.easeOut, _loc4._x, arrayMcX[i], 6.000000E-001, true);
            } // end of for
            for (i = 1; i < this.index; i++)
            {
                var _loc3 = _root["im" + i];
                var tweenLastX1 = new mx.transitions.Tween(_loc3, "_x", mx.transitions.easing.Regular.easeOut, _loc3._x, arrayMcX[i], 6.000000E-001, true);
            } // end of for
        } // end if
    };
    item.area.onRelease = function ()
    {
        if (_root.Cont != 1)
        {
            _root.cont.gotoAndPlay("up");
            _root.mov = 1;
            link = this.index;
            mcMainMenu["btn" + link].gotoAndPlay("out");
            btnName = _root["im" + this.index];
            btnName.gotoAndPlay("out");
            mcMainMenu["btn" + link].gotoAndPlay("over");
            _root.Content();
            _root.Cont = 1;
            _root.submenu.sub.gotoAndStop(_root.link);
        } // end if
    };
} // end of for
_root.submenu.area.onRollOver = function ()
{
    if (link != 4 && _root.Cont != 1)
    {
        btnName = _root.im4;
        btnName.gotoAndPlay("over");
        tweenXScale.stop();
        tweenYScale.stop();
        tweenBtnY.stop();
        var tweenXScale = new mx.transitions.Tween(btnName, "_xscale", mx.transitions.easing.Strong.easeOut, btnName._xscale, scaleBtnEndX, 4.000000E-001, true);
        var tweenYScale = new mx.transitions.Tween(btnName, "_yscale", mx.transitions.easing.Strong.easeOut, btnName._yscale, scaleBtnEndY, 4.000000E-001, true);
        var tweenBtnY = new mx.transitions.Tween(btnName, "_y", mx.transitions.easing.Strong.easeOut, btnName._y, btnEndY, 4.000000E-001, true);
        tweenLastX2.stop();
        tweenLastX1.stop();
        for (i = 5; i <= countMenuBtns; i++)
        {
            var _loc3 = _root["im" + i];
            var tweenLastX2 = new mx.transitions.Tween(_loc3, "_x", mx.transitions.easing.Regular.easeOut, _loc3._x, arrayMcX[i] + deltaMoveX, 6.000000E-001, true);
        } // end of for
        for (i = 1; i < 4; i++)
        {
            var _loc2 = _root["im" + i];
            var tweenLastX1 = new mx.transitions.Tween(_loc2, "_x", mx.transitions.easing.Regular.easeOut, _loc2._x, arrayMcX[i] - deltaMoveX, 6.000000E-001, true);
        } // end of for
    } // end if
};
_root.submenu.area.onRollOut = item.area.onReleaseOutside = function ()
{
    if (link != 4 && _root.Cont != 1)
    {
        btnName = _root.im4;
        btnName.gotoAndPlay("out");
        tweenXScale.stop();
        tweenYScale.stop();
        tweenBtnY.stop();
        var tweenXScale = new mx.transitions.Tween(btnName, "_xscale", mx.transitions.easing.Regular.easeOut, btnName._xscale, scaleBtnStartX, 6.000000E-001, true);
        var tweenYScale = new mx.transitions.Tween(btnName, "_yscale", mx.transitions.easing.Regular.easeOut, btnName._yscale, scaleBtnStartY, 6.000000E-001, true);
        var tweenBtnY = new mx.transitions.Tween(btnName, "_y", mx.transitions.easing.Regular.easeOut, btnName._y, btnStartY, 6.000000E-001, true);
        tweenLastX2.stop();
        tweenLastX1.stop();
        tweenLastAlpha1.stop();
        tweenLastAlpha2.stop();
        tweenLastAlpha1_2.stop();
        tweenLastAlpha2_2.stop();
        for (i = 5; i <= countMenuBtns; i++)
        {
            var _loc3 = _root["im" + i];
            var tweenLastX2 = new mx.transitions.Tween(_loc3, "_x", mx.transitions.easing.Regular.easeOut, _loc3._x, arrayMcX[i], 6.000000E-001, true);
        } // end of for
        for (i = 1; i < 4; i++)
        {
            var _loc2 = _root["im" + i];
            var tweenLastX1 = new mx.transitions.Tween(_loc2, "_x", mx.transitions.easing.Regular.easeOut, _loc2._x, arrayMcX[i], 6.000000E-001, true);
        } // end of for
    } // end if
};
_root.submenu.area.onRelease = function ()
{
    if (_root.Cont == 1 && _root.link != 4)
    {
        _root.link = 4;
        _root.cont.gotoAndPlay("chang");
        _root.submenu.sub.gotoAndStop(_root.link);
    } // end if
    if (_root.Cont != 1)
    {
        _root.cont.gotoAndPlay("up");
        _root.mov = 1;
        link = 4;
        mcMainMenu["btn" + link].gotoAndPlay("out");
        btnName = _root.im4;
        btnName.gotoAndPlay("out");
        mcMainMenu["btn" + link].gotoAndPlay("over");
        _root.Content();
        _root.Cont = 1;
        _root.submenu.sub.gotoAndStop(_root.link);
    } // end if
};
_root.Content = function ()
{
    for (i = 1; i <= countMenuBtns; i++)
    {
        _root.tweenC = new mx.transitions.Tween(this["im" + i], "_x", mx.transitions.easing.Regular.easeOut, this["im" + i]._x, _root.ContPos[i], 6.000000E-001, true);
        _root.tweenC.onMotionFinished = function ()
        {
            _root.mov = 0;
            var _loc2 = new mx.transitions.Tween(_root["im" + link], "_xscale", mx.transitions.easing.Regular.easeOut, _root["im" + link]._xscale, scaleBtnStartX, 3.000000E-001, true);
            var _loc3 = new mx.transitions.Tween(_root["im" + link], "_yscale", mx.transitions.easing.Regular.easeOut, _root["im" + link]._yscale, scaleBtnStartY, 3.000000E-001, true);
            var _loc4 = new mx.transitions.Tween(_root["im" + link], "_y", mx.transitions.easing.Regular.easeOut, _root["im" + link]._y, btnStartY, 3.000000E-001, true);
        };
    } // end of for
};
_root.ContPos[1] = _root.im1._x - 500;
_root.ContPos[2] = _root.im2._x - 500;
_root.ContPos[3] = _root.im3._x + 500;
_root.ContPos[4] = _root.im4._x + 500;
_root.BackMenu = function ()
{
    for (i = 1; i <= countMenuBtns; i++)
    {
        _root.tweenBack = new mx.transitions.Tween(_root["im" + i], "_x", mx.transitions.easing.Regular.easeOut, _root["im" + i]._x, _root.arrayMcX[i], 6.000000E-001, true);
        _root.tweenBack.onMotionFinished = function ()
        {
            _root.mov = 0;
        };
    } // end of for
};
_root.sec2 = 1;
_root.uppear = function ()
{
    _root["im" + _root.sec2]._alpha = 100;
    _root["tweenXpos" + _root.sec2] = new mx.transitions.Tween(_root["im" + _root.sec2], "_yscale", mx.transitions.easing.Regular.easeOut, 5, 82, 1, true);
    _root["tweenYpos" + _root.sec2] = new mx.transitions.Tween(_root["im" + _root.sec2], "_xscale", mx.transitions.easing.Regular.easeOut, 5, 82, 1, true);
};
_root.uppear();

Por limberg

0 de clabLevel



Genero:Masculino  

chrome
Citar            
MensajeEscrito el 24 Feb 2011 04:19 am
Que buena forma de presentarte....

Por MaxiiSan20

Claber

168 de clabLevel



Genero:Masculino  

Montevideo

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.