Foros del Web » Creando para Internet » Flash y Actionscript »

scroll con barra de arrrastre e easing

Estas en el tema de scroll con barra de arrrastre e easing en el foro de Flash y Actionscript en Foros del Web. hola, tengo un scroll vertival con barra de despl botnes de subida y bajada y efecto easing al pasar el raton por encima del contenido, ...
  #1 (permalink)  
Antiguo 16/05/2009, 06:21
 
Fecha de Ingreso: diciembre-2008
Mensajes: 28
Antigüedad: 15 años, 4 meses
Puntos: 0
scroll con barra de arrrastre e easing

hola, tengo un scroll vertival con barra de despl botnes de subida y bajada y efecto easing al pasar el raton por encima del contenido, tb funcion de rueda de mouse, bueno, el caso que funciona casi bien por que al inciar la pelicula el contenido empieza un poquitin mas abajo de el origen de la mascara clip enmascarado y sube hasta la posicion en la que deberia de estar al ppio, me ha pasado casi siempre que he intentado hacer un scroll.
Segundo problema, que cargo este clip swf dentro de otro main (loadMovei), y se fastidia el tema de la cordenada _y, solo en la funcion easing (al pasar el raton por encima del contenido), les dejo el codigo para que lo revisen , tb podria venirles bien. Gracias por adelantado
Código:
function scrolling(easing, auto, mouse)
{
    function updateContentPos()
    {
        var _l1 = (dragger._y - btnup._y - btnup._height) / (scrollHeight - dragger._height);
        contentMain.newY = Math.round(top_scroll - scrollable * _l1);
        //trace(contentMain.newY);
    } // End of the function
    var moveSpeed = 1;
    var easingSpeed = 20;
    var scrollHeight = scrollbg._height;
    var scrollable = contentMain._height - maskedView._height + 2;
    var top_scroll = contentMain._y;
    var left = scrollbg._x - 2;
    var top = scrollbg._y;
    var right = scrollbg._x - 2;
    var bottom = scrollbg._y + scrollbg._height - dragger._height;
    if (scrollable < 0)
    {
        dragger._visible = false;
        btnup._alpha = 0;
        btndown._alpha = 0;
        scrollbg._alpha = 0;
        btnup.enabled = false;
        btndown.enabled = false;
        return(undefined);
    } // end if
    contentMain.onEnterFrame = function ()
    {
        if (!easing || easing == undefined)
        {
            this._y = this.newY;
        }
        else
        {
            this._y = this._y + (this.newY - this._y) / easingSpeed;
        } // end if
    };
    dragger.onPress = function ()
    {
        startDrag(this, false, left, top, right, bottom);
        this.onMouseMove = function ()
        {
            updateContentPos();
        };
    };
    dragger.onRelease = dragger.onReleaseOutside = function ()
    {
        stopDrag();
        delete this["onEnterFrame"];
    };
    btnup.onPress = function ()
    {
        this.onEnterFrame = function ()
        {
            dragger._y = Math.max(top, dragger._y - moveSpeed);
            updateContentPos();
        };
    };
    btnup.onRelease = function ()
    {
        delete this["onEnterFrame"];
    };
    btndown.onPress = function ()
    {
        this.onEnterFrame = function ()
        {
            dragger._y = Math.min(bottom, dragger._y + moveSpeed);
            updateContentPos();
        };
    };
    btndown.onRelease = function ()
    {
        delete this["onEnterFrame"];
    };
    updateContentPos();
    if (auto == true)
    {
        onEnterFrame = function ()
        {
            if (dragger._y < bottom)
            {
                dragger._y = dragger._y + 0.300000;
                updateContentPos();
            }
            else
            {
                dragger._y = top;
            } // end if
        };
    } // end if
    if (mouseWheel == true)
    {
        var _l2 = new Object();
        _l2.onMouseWheel = function (delta)
        {
            if (dragger._y < bottom)
            {
                dragger._y = dragger._y + (delta + 3);
                updateContentPos();
            }
            else
            {
                dragger._y = bottom - 3;
            } // end if
            if (dragger._y > top)
            {
                dragger._y = dragger._y + delta;
                updateContentPos();
            }
            else
            {
                dragger._y = top;
            } // end if
        };
        Mouse.addListener(_l2);
    } // end if
    if (mouseCoord == true)
    {
             maskedView.onEnterFrame = function ()
        {
            if (this.hitTest(_xmouse, _ymouse, false))
            {
                dragger._y = _ymouse;
                updateContentPos();
                if (dragger._y > bottom)
                {
                 dragger._y = bottom;
                    updateContentPos();
                } // end if
            } // end if
        };
    } // end if
    if (barVisual == false)
    {
        dragger._visible = false;
        btnup._alpha = 0;
        btndown._alpha = 0;
        scrollbg._alpha = 0;
        btnup.enabled = false;
        btndown.enabled = false;
    } // end if
} // End of the function
stop();
System.useCodepage = true;
var easing = true;
var auto = false;
var mouseWheel = true;
var mouseCoord = true;
var barVisual = true;
var space = 5; //esto no hace nada



contentMain.setMask(maskedView);
scrolling(easing, auto, mouseWheel, mouseCoord, barVisual);
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:27.