BUSCA

Links Patrocinados



Buscar por Título
   A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


Action Script
()

Publicidade
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; } }



Resumos Relacionados


- Gta - Sanandreas - Parte 3

- Gta Sanandreas - Parte 1

- Gta Sanandreas - Parte 2

- Manipulando Eventos Do Teclado (swishscript)

- Tabuada Em Pascal



Passei.com.br | Biografias

FACEBOOK


PUBLICIDADE




encyclopedia