Ir para conteúdo

POWERED BY:

Arquivado

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

Web Design Valdeci

animação de movimentar com o mouse

Recommended Posts

Vo da uma #@?$%~ mão pra ti heim.......

 

Não sei se vai funcionar pra ti, mas já resolvi um outro cara com problema parecido.....

 

Crie o movieclip de fundo e coloque esse código nele em AS2

onClipEvent (load) {
	_root.ini = true;
	_root.arrast = false;
	_root.mao._visible = true;
}
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;
	}
}

os valores negativos são referentes ao tamanho da imagem...... quanto maior a imagem maior sera o numero negativo.... quanto menor.... menor o numero..

 

Teste ai veja o que aconteceu....

 

Poste seu código e assim vai...

 

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.