No soy muy bueno para flash y necesito de alguien que me pueda ayudar con lo siguiente
tengo un scroll que funciona horizontalmente y quiero modificarle el código para que me funcione verticalmente, pero no e podido, donde esta la "X" la reemplazo por "Y" y lo que pasa es que no funciona ni horizontal ni verticalmente
Código :
var myListener = new Object();
myListener.onResize = function ()
{
updateLocations();
};
Stage.addListener(myListener);
updateLocations = function ()
{
initialWidth = 0;
initialHeight = 0;
currentWidth = Stage.width;
currentHeight = Stage.height;
contentWidth = contentClip._width;
contentClip._y = Math.round(initialHeight / 2 - contentClip._height / 2);
if (contentClip._width < currentWidth)
{
newX = Math.round(initialWidth / 2 - contentClip._width / 2);
}
else
{
positionContent();
newX = Math.round(initialWidth / 2 - contentClip._width / 2);
} // end else if
};
updateLocations();
buffer = 0;
this.onMouseMove = function ()
{
if (this._xmouse > Math.floor((initialWidth - currentWidth) / 2) && this._xmouse < Math.floor(initialWidth + 2 * ((currentWidth - initialWidth) / 2)) && this._ymouse > contentClip._y && this._ymouse < contentClip._y + contentClip._height)
{
if (contentClip._width > currentWidth)
{
positionContent();
} // end if
} // end if
};
positionContent = function ()
{
mousePercent = (this._xmouse + (currentWidth - initialWidth) / 2) / currentWidth;
availMovement = contentClip._width - currentWidth + buffer * 2;
newX = Math.floor(-mousePercent * availMovement) - (currentWidth - initialWidth) / 2 + buffer * 2 / 2;
};
if (contentClip._width > currentWidth)
{
newX = Math.floor((initialWidth - currentWidth) / 2) + buffer;
}
else
{
newX = Math.floor(initialWidth / 2 - contentClip._width / 2);
} // end else if
holder = contentClip._x;
easeContent = function ()
{
if (newX != contentClip._x)
{
destx = newX;
posx = holder;
velx = (destx - posx) / 4;
holder = holder + velx;
contentClip._x = Math.round(holder);
} // end if
};
contentClip.onEnterFrame = function ()
{
easeContent();
};
updateLocations();
stop (); 