Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Dieguinhu Web

Problema com scroll

Recommended Posts

Gente tenho um problemão!! Daqueles.....rsrrsrs

 

 

é o seguinte tenho um scroll que puxa informações do banco de daods num dynamic text...até ai beleza ele funciona...só que tem um erro....

 

 

 

 

Quando termina as informações,o scroll continua descendo sendo que...eu precisava que quando terminasse as informações ele travasse

 

 

não continuasse de acordo com o TAMANHO do dynamic text...e sim de acordo com as informações vinda do banco....

 

 

 

hehehe

 

alguem sabe que isso não sei....

 

abraço.....

Compartilhar este post


Link para o post
Compartilhar em outros sites

function scrollUpdate()
{
	var _loc2 = this._parent.texto;
	if (_loc2._height < this.bg._height)
	{
		this._visible = false;
	}
	else
	{
		this._visible = true;
	} // end else if
	var _loc5 = _loc2._height - this.bg._height;
	var _loc7 = this.bg._height - this.barra._height;
	var _loc6 = _loc5 / _loc7;
	var _loc4 = 2;
	var _loc3 = -this.barra._y * _loc6 + this.hxini;
	_loc3 = Math.floor(_loc3);
	_loc2._y = Math.floor((_loc2._y * _loc4 + _loc3) / (_loc4 + 1));
} // End of the function
function starmeuScroll()
{
	yfin = this._parent.bg._height - this._height;
	this.startDrag("", this._x, 0, this._x, yfin);
} // End of the function
function stopScroll()
{
	this.stopDrag();
} // End of the function
function moveScroll(dir)
{
	if (dir == "stop")
	{
		delete controlador.onEnterFrame;
	}
	else
	{
		var barra = this.barra;
		var vel = 4;
		if (dir == "cima")
		{
			var lim = 0;
			vel = vel * -1;
		}
		else
		{
			var lim = this.bg._height - barra._height;
		} // end else if
	} // end else if
	controlador.onEnterFrame = function ()
	{
		if (dir == "baixo")
		{
			if (barra._y + vel < lim)
			{
				barra._y = barra._y + vel;
			}
			else
			{
				barra._y = lim;
			} // end else if
		}
		else if (barra._y + vel > lim)
		{
			barra._y = barra._y + vel;
		}
		else
		{
			barra._y = lim;
		} // end else if
	};
} // End of the function
this.hxini = this._parent.texto._y;
this.onEnterFrame = scrollUpdate;
this.barra.onPress = starmeuScroll;
this.barra.onRelease = stopScroll;
this.barra.onReleaseOutside = stopScroll;
this.createEmptyMovieClip("controlador", 100);

_root.tudo.bt_desce.onPress = function (){
	moveScroll("baixo");
};

_root.tudo.bt_sobe.onPress = function (){
	moveScroll("cima");
};

_root.tudo.bt_desce.onRelease = function (){
	moveScroll("stop");
};

_root.tudo.bt_sobe.onRelease = function (){
	moveScroll("stop");
};


sup.onPress = function ()
{
	moveScroll("cima");
};
sup.onRelease = inf.onRelease = function ()
{
	moveScroll("stop");
};
inf.onPress = function ()
{
	moveScroll("baixo");
};
inf.onRelease = function ()
{
	moveScroll("stop");
};
barra.useHandCursor = false;
sup.useHandCursor = false;
inf.useHandCursor = false;

 

 

precisava tambem que quando o usuario abaixa e muda de link o scroll volta pra cima não ficar embaixo quando muda de link se você puder me ajudar agradeço

 

abraço!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.