Ir para conteúdo

Arquivado

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

ddelucca

[Resolvido] como parar

Recommended Posts

e ae galera, ninguém sabe como faço pra parar de rolar com o mouse ñ?! tenho q por este site no ar e to perdidão. ñ sei mais o q fazer :mellow:

 

valeu galera

Compartilhar este post


Link para o post
Compartilhar em outros sites

onClipEvent(load){
//	fscommand("allowscale", false);
	_root.ini = true;
	_root.arrast = false;
	_root.mao._visible = false;
}
onClipEvent(mouseDown) { // <======= controla as opções de mouse
	_root.clique._visible=false;
	_root.ini = false;
//	_root.mao.startDrag();
	_root.mao._visible = true;
	x = (_xmouse+this._x);
	_root.mao._x = x;
	_root.mao._y = _ymouse;
	_root.arrast = true;
//	y = (x-_xmouse)/50;
}
onClipEvent(mouseUp) {
//	_root.mao.stopDrag();
	_root.mao._visible = false;
//	x = _xmouse;
	_root.arrast = false;
}
onClipEvent(enterFrame){
	if (_root.ini) {
		this._x -= 0; // <============= aqui é que ele faz se movimentar como estava no 2 a animação tava andando a 2 frames por segundo no 0 ele fica parado.
	}
	if (key.isDown(key.LEFT)) {
		_root.ini = false;
		this._x += 5; // <======= controla a velocidade que o clip vai andar de acordo com a seta do teclado apertada no caso a seta esquerda, e vai fazer andar 5 frames por segundo.
	}
	else if (key.isDown(key.RIGHT)) {
		_root.ini = false;
		this._x -= 5; // <======= controla a velocidade que o clip vai andar de acordo com a seta do teclado apertada no caso a seta direita, e vai fazer andar 5 frames por segundo.
	}
	if(this._x>1) {	// <============= controla o tamanho do clip
		this._x = -1730;
	}
	else if (this._x<(-1730)) {  // <============ controla quando ele vai recomeçar
		this._x = 0;
	}
//	trace((_xmouse+this._x));
	if (_root.arrast) {
//		x += 
		this._x += (x-(_xmouse+this._x))/10;
		y = (x-(_xmouse+this._x));
		if (y > 0) {
			_root.mao.prevFrame();
		}else if (y < 0) {
			_root.mao.nextFrame();
		}
//		trace (x+"  "+(_xmouse));
	}
//	if (_xmouse>400 | _xmouse<0 | _ymouse<0 | _ymouse>300) {
//		_root.mao.stopDrag();
//		_root.mao._visible = false;
//		_root.arrast = false;
//	}
}

Bom amigo o código que você procura é

_root.arrast = true;

 

Esse é quem controla o mouse :)

 

Tudo que você precisa fazer é criar uma função para que ele pare antes da altura -1710 ou antes da 0

 

Como você vai fazer isso??? não faço a menorrrrrrrrrrrrrrrrrrr ideia.......

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá

desculpe a demora, mas tente fazer assim:

 

onClipEvent (load) {
	_root.ini = true;
	_root.arrast = false;
	_root.mao._visible = false;
}
onClipEvent (mouseDown) {
	_root.clique._visible = false;
	_root.ini = false;
	_root.mao._visible = true;
	x = (_xmouse + this._x);
	_root.mao._x = x;
	_root.mao._y = _ymouse;
	_root.arrast = true;
}
onClipEvent (mouseUp) {
	_root.mao._visible = false;
	_root.arrast = false;
}
onClipEvent (enterFrame) {
	if (_root.ini) {
		this._x -= 0;
	}
	if (key.isDown(key.LEFT)) {
		_root.ini = false;
		this._x += 5;
	} else if (key.isDown(key.RIGHT)) {
		_root.ini = false;
		this._x -= 5;
	}
	   /* // estava aqui, joguei essa parte dentro do if (_root.arrast)
	if (this._x >= 1) {
		this._x = 1;
	} else if (this._x <= (-1730)) {
		this._x = -1730;
	}*/

	if (_root.arrast) {
		if (this._x >= 1) {// adicionei um =
			this._x = 1;// troquei o valor para 1
		} else if (this._x <= (-1730)) {// adicionei um =
			this._x = -1730; // troquei o valor para -1730
		}
		this._x += (x - (_xmouse + this._x)) / 10;
		y = (x - (_xmouse + this._x));
		if (y > 0) {
			_root.mao.prevFrame();
		} else if (y < 0) {
			_root.mao.nextFrame();
		}
	}
}

Se não entender algo q eu fiz, posta ae

Compartilhar este post


Link para o post
Compartilhar em outros sites

onClipEvent (load) {

_root.arrast = false;

_root.mao._visible = false;

}

onClipEvent (mouseDown) {

_root.clique._visible = false;

_root.mao._visible = true;

x = (_xmouse + this._x);

_root.mao._x = x;

_root.mao._y = _ymouse;

_root.arrast = true;

}

onClipEvent (mouseUp) {

_root.mao._visible = false;

_root.arrast = false;

}

on (keyPress "<Left>") {

a += 5;

}

on (keyPress "<Right>") {

a -= 5;

}

onClipEvent (enterFrame) {

if (_root.arrast) {

a += (x - (_xmouse + this._x)) / 10;

y = (x - (_xmouse + this._x));

if (y > 0) {

_root.mao.prevFrame();

} else if (y < 0) {

_root.mao.nextFrame();

}

}

if (a >= 1) {

a = 1;

} else if (a <= (-1730)) {

a = -1730;

}

this._x = a;

}

Compartilhar este post


Link para o post
Compartilhar em outros sites

o lance é q eu ñ sqaco muito dessas parte irmão http://forum.imasters.com.br/public/style_emoticons/default/assobiando.gif

 

mas então brother, parou de vazar, só q agora fica ativado direto, sem poder usar os links. já fica com a mãozinha ativa.

e logo q inicia, se você clica pra ir pra esquerda, ele pula pra lá como se tivesse indo pra outra imagem

 

vou upar pra você ver brother: http://www.brunaolly.com.br/new/

 

malz ta incomodando vei

Compartilhar este post


Link para o post
Compartilhar em outros sites

E com a ajuda de nosso amigo ai em cima :D

 

Eis a Solução :D

 

onClipEvent (load) {
	_root.ini = true;
	_root.arrast = false;
	_root.mao._visible = false;
}
onClipEvent (mouseDown) {
	_root.clique._visible = false;
	_root.ini = false;
	_root.mao._visible = true;
	x = (_xmouse + this._x);
	_root.mao._x = x;
	_root.mao._y = _ymouse;
	_root.arrast = true;
}
onClipEvent (mouseUp) {
	_root.mao._visible = false;
	_root.arrast = false;
}
onClipEvent (enterFrame) {
	if (_root.ini) {
		this._x -= 0;
	}
	if (key.isDown(key.LEFT)) {
		_root.ini = false;
		this._x += 5;
	} else if (key.isDown(key.RIGHT)) {
		_root.ini = false;
		this._x -= 5;
	}
	if (_root.arrast) {
		this._x += (x - (_xmouse + this._x)) / 10;
		y = (x - (_xmouse + this._x));
		if (y > 0) {
			_root.mao.prevFrame();
		} else if (y < 0) {
			_root.mao.nextFrame();
		}
	}
	if (this._x >= 1) {
		this._x = 1;
	} else if (this._x <= (-1730)) {
		this._x = -1730;
	}
}

Detalhe podendo usa a mãozinha para clicarrrrrrrrr

Podendo usar as setas.......

 

Ninguem entra na parte preta ;)

 

Have Fun!!

 

E obrigado por me ajuda rs aprendi bastante mexendo no seu código ;)

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

ow meu brother, valeu msm http://forum.imasters.com.br/public/style_emoticons/default/clap.gif

 

brigadão pela força ae e agradeço os outros também q ajudaram :)

valeu msm galera, vcs mandaram benzaço http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif

 

tópico encerrado com louvor esse http://forum.imasters.com.br/public/style_emoticons/default/joia.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

IIII manin ainda ta com duvida nisso????

 

huaEhoaeia tem diversas maneiras

 

Depois de um clic ligar...

 

deixar já ligado desde o começo :P

 

Da uma estudada no seu código vai :P

 

Sai mudando as variaveis rs

Compartilhar este post


Link para o post
Compartilhar em outros sites

ixi irmão, sou uma negação no flash :P

 

vou mais pro design e pra montagem dele

e f*** q falta o tempo pra estudar o flash né :mellow:

 

esse site msm tenho q por no ar agora a tarde

Compartilhar este post


Link para o post
Compartilhar em outros sites

uma solução rápida que posso te dar

 

é ao clicar uma vez ele já faz o comando sozinho

 

onClipEvent (mouseUp) {
	_root.mao._visible = false;
	_root.arrast = false;
}

Se muda o _root.arrast para true... que ao dar um clic ele já vai ficar com a função do mouse ligada...... agora ele obedecer sozinho o mouse ao entrar tem que usar a função onClipEvent (mouseMove).

 

E eu to literalmente sem tempo hj para lembrar o código ^^

 

Abraços

Espero ter ajudado

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.