Jump to content


Photo

Como Fazer Um Movie Clipe Se Movimentar


  • Faça o login para participar
1 reply to this topic

#1 miguelgustavo

miguelgustavo

    Novato no fórum

  • Usuários
  • 3 posts
  • Sexo:Não informado

Posted 20/04/2009, 15:51

Como Fazer um movie clipe se movimentar tipo esses sites

http://jeitomoleque.uol.com.br/ - http://www.nutella.com.br/


Eu criei um movie clip e um botão

na time line usei isto

function mov () {
this.onEnterFrame = function () {
if(_root.clientesmc._y >= 246){ //limite que o mc deve atingi
_root.clientesmc._y -= 20; //velocidade que ele vai anadar
}else{
stop();
delete this.onEnterFrame;
}
}
}

e no botão

on(release){
mov();
}


Sendo que não funciona,

obrigado,

Consegui, abaixo segue o código




onClipEvent(enterFrame)
{
tempo = 20;
}

onClipEvent(enterFrame)
{
endX = 400 - _xmouse;
_x = _x + (endX - _x) / tempo;
}

onClipEvent(enterFrame)
{
if (this._x < -130)
{
this._x = -130;
}

if (this._x > 950)
{
this._x = 950;
}

}
onClipEvent(enterFrame)
{
tempo = 20;
}

onClipEvent(enterFrame)
{
endY = 150 - _ymouse;
_y = _y + (endY - _y) / tempo;
}

onClipEvent(enterFrame)
{
if (this._y < 200)
{
this._y = 200;
}

if (this._y > 250)
{
this._y = 250;
}

}

Edição feita por: miguelgustavo, 20/04/2009, 15:51.


#2 Sheepman

Sheepman

    Veterano

  • Usuários
  • 1497 posts
  • Sexo:Masculino
  • Localidade:Porto Alegre - RS

Posted 28/04/2009, 12:47

Miguel,
Eu recomendo que tu faça uso de uma classe para Tween's, porque, além de ser muito mais simples, você tem um controle muito maior sobre a animação. Eu costumo usar a seguinte biblioteca: http://blog.greensoc...m/tweenliteas3/

Também acho que seria legal tu tentar utilizar o AS3, pois a sintaxe de código que você está usando é AS1, e ela é meio limitada. :)

Fica aí as dicas. Abraço
Mozart Petter - http://www.mozartpetter.com/
Não sabe o que é herança? clique aqui e descubra.




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq