Ir para conteúdo

POWERED BY:

Arquivado

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

buh

problema em scroll

Recommended Posts

galera tenhu uma scroll em flash que ta meio estranha..

 

ela tava recebendo textos de um arquivo externo PHP, em um scroll que eu tinha tava sussa que eu descia a scroll ate o fim acabava a rolagem mais ainda tinha texto pra ser rolado ;S

 

dai troquei a scroll a nova scroll tem dois problemas.. o texto é beim grande.. quando inicia a aplicação flash o texto aparece do inicio certinho so que vai subindo dai para escondendo a parte inicial do texto.. dai você rola a rolagem ela desce ate acabar ao que ainda com texto pra ser rolado..

 

 

por que isso acontece?? eu nuam determino no meu codigo o quanto vai rolar ou não por que ele acaba antes de o texto acabar??

e o problema da segunda scroll? que esconde o inicio do texto e nuam rola ate o fim??

 

alguem ja teve esse problema e conseguiu resolver??

 

 

PS: ja tentei com texto externo PHP e tmb dentro do proprio flash anbos naum mudam nada.

Compartilhar este post


Link para o post
Compartilhar em outros sites

o primeiro scroll tinha uma setinha pra cima outra pra baxo e era simples

 

tinha um movieclip com o script

 


onClipEvent(enterFrame) {
	if (up) _parent.texto_distribuidores.texto.scroll--;

	if (down) _parent.texto_distribuidores.texto.scroll++;
}

dai dentro do movieclip seta pra baxo

 

on (press) { down = true; }
on (release) { down= false; }

 

dai dentro do movieclip seta pra cima

 

on (press) { up = true; }
on (release) { up= false; }

 

 

 

o outra scroll

 

 

scrolling = function (easing) {
	var moveSpeed:Number = 5;
	var easingSpeed:Number = 10;
	var scrollHeight:Number = scrollbg._height;
	// amount of scroll
	var scrollable:Number = texto_distribuidores._height-maskedView._height;
	var initContentPos:Number = texto_distribuidores._y;
	// the drag positions that are possible for the dragger
	var left:Number = scrollbg._x;
	var top:Number = scrollbg._y;
	var right:Number = scrollbg._x;
	var bottom:Number = scrollbg._height-dragger._height+scrollbg._y;
	// checking if the content is even scrollable
	if (scrollable<0) {
		dragger._visible = false;
		btnUp.enabled = false;
		btnUp._alpha = 50;
		btnDown._alpha = 50;
		scrollbg._alpha = 50;
		btnDown.enabled = false;
		return;
	}
	// current position updater        
	function updateContentPos() {
		var percent_scrolled:Number = (dragger._y-btnUp._height)/(scrollHeight-dragger._height);
		// instead of setting the _y property directly, we simple set newY
		// that way we can adjust how we handle the new Y coordinate we'd like to move to
		texto_distribuidores.newY = Math.round(initContentPos-(percent_scrolled*scrollable));
	}
	// position to move to
	texto_distribuidores.onEnterFrame = function() {
		if (!easing || easing == undefined) {
			this._y = this.newY;
		} else {
			this._y += Math.round((this.newY-this._y)/easingSpeed);
		}
	};
	dragger.onPress = function() {
		startDrag(this, false, left, top, right, bottom);
		this.onMouseMove = function() {
			updateContentPos();
		};
	};
	dragger.onMouseUp = function() {
		stopDrag();
		delete this.onMouseMove;
	};
	btnUp.onPress = function() {
		this.onEnterFrame = function() {
			dragger._y = Math.max(top, dragger._y-moveSpeed);
			updateContentPos();
		};
	};
	btnUp.onDragOut = function() {
		delete this.onEnterFrame;
	};
	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;
	};
	btnDown.onDragOut = function() {
		delete this.onEnterFrame;
	};
	// user offset to update
	updateContentPos();
	//checking where the mouse was
	areaJump = function () {
		var maxHeight = 120;
		var mouse = _ymouse;
		var maxMouse = 179;
		var minMouse = 20;
		var mouseLimits = maxMouse-minMouse;
		var mousePer = (mouse)/maxMouse;
		var posY = mousePer*mouseLimits;
		moveDragger(posY);
	};
	//moving the dragger and content
	function moveDragger(where) {
		dragger._y = where;
		updateContentPos();
	}
	
	scrollbg.onRollOver = function() {
		this.useHandCursor = false
}

	scrollbg.onRelease = function() {
		areaJump();
	};
};
// turn easing to true or false
scrolling(true);
texto_distribuidores.setMask(maskedView);

seta pra cima

 

onClipEvent(load){
	this.useHandCursor = false
	this.stop()
}
on (press) {
	this.gotoAndStop(3)
}
on (release){
	this.gotoAndStop(1)
}

 

onClipEvent(load){
	this.useHandCursor = false
}
seta pra baxo

onClipEvent(load){
	this.useHandCursor = false
	this.stop()
}
on (press) {
	this.gotoAndStop(3)
}
on (release){
	this.gotoAndStop(1)
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olha esse teu código ai é mto grande rs...

 

Nem olhei ele...

Mas esse aqui eu sei que funciona:

//Carrego meu texto
texto.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ligula massa, lacinia eget molestie sit amet, luctus id nisl. Morbi sed commodo nulla. Nulla commodo, ligula ut commodo luctus, enim risus adipiscing urna, fringilla malesuada massa turpis ac magna. Ut lorem est, sagittis eu feugiat eu, dapibus quis enim. Nulla facilisi. Maecenas feugiat venenatis aliquet. Proin lacinia, dolor commodo ullamcorper consequat, ipsum nisi blandit ipsum, quis mollis turpis nisl eu orci. Mauris nisl ipsum, consequat sit amet imperdiet accumsan, suscipit vel dui. Nunc nec feugiat ipsum. In pretium, dolor sed aliquet fermentum, magna mi facilisis justo, in sagittis mauris quam et metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam erat volutpat. Nulla quis eros sit amet purus consectetur faucibus sed a metus. Aliquam ornare magna quis leo rutrum congue. Praesent augue nisl, volutpat in auctor eget, consectetur viverra augue. Aenean in egestas purus. Nunc convallis aliquam condimentum. Aliquam nec metus dolor. Praesent quis faucibus lorem. Duis eget ligula vitae turpis imperdiet elementum. ";

var verifica = 0;

this.onEnterFrame = function(){
	trace(verifica);
	switch(verifica){
		case 1:
			texto.scroll--;
			break
		case 2:
			texto.scroll++;
			break;
		default:
			break;
	}
}

//botões
sobe.onPress = function(){
	verifica = 1;
}

sobe.onRelease = function(){
	verifica = 0;
}

desce.onPress = function(){
	verifica = 2;
}

desce.onRelease = function(){
	verifica = 0;
}

Abraços

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.