• Registrar-se
  • ‎O que é o Shvoong?‎
  • Entrar
    Entrar
    Lembrar meu nome de usuário Esqueceu sua senha?

Resumos e revisões curtas

.

.

Action Script

por : mizaelmsales    


Baixe o arquivo inseto.fla que está na minha página http://www.cefetce.br/Regis/fmi.php e salve-o.   No filme, existe
um pequeno inseto que será controlado pelas setas do teclado. A primeira tarefa será a de colocar um nome de instância, neste caso, inseto_mc. Renomeie a camada 1 para inseto. Crie uma nova camada chamada actions, tecle F9 e digite o seguinte código:   inseto_mc. velocidade=10; teclado = new Object(); Key.addListener( teclado );   teclado.onKeyDown = function() {           switch( Key.getCode() ) {          case 37:               inseto_mc.esquerda = true;               break;                        case 38:               inseto_mc.cima = true;               break;                        case 39:               inseto_mc.direita = true;               break;                        case 40:               inseto_mc.baixo = true;               break;                   case 32:               inseto_mc.espaco = true;      } }   teclado.onKeyUp = function() {           switch( Key.getCode() ) {          case 37:               inseto_mc.esquerda = false;               break;                        case 38:               inseto_mc.cima = false;               break;                        case 39:               inseto_mc.direita = false;               break;                        case 40:               inseto_mc.baixo = false;               break;                   case 32:               inseto_mc.espaco = false;      } }   inseto_mc.onEnterFrame = function() {           if ( this.cima )      {          this._rotation=0;          if ( ( this._y - ( this._height / 2 ) ) > 0 )               this._y -= this. velocidade;      }               if ( this.baixo )      {          this._rotation=180;          if ( ( this._y + ( this._height / 2 ) ) < Stage.height )               this._y += this. velocidade;      }               if ( this.esquerda )      {          this._rotation=-90;          if ( ( this._x - ( this._width / 2 ) ) > 0 )               this._x -= this. velocidade;      }               if ( this.direita )      {          this._rotation=90;          if ( ( this._x + ( this._width / 2 ) ) < Stage.width )               this._x += this. velocidade;      }      }
Publicado em: setembro 13, 2007
Avalie este resumo : 1 2 3 4 5

Adicione aos favoritos & envie aos amigos

.