Código HTML:
iniciarJuego_btn.onRelease=function(){ //Iniciar graficos ahorcado_mc.gotoAndStop("jugar"); iniciarJuego_btn._visible = false; interface_mc._visible = true; interface_mc.display_txt.text = ""; //Selecciona una palabra al azar y contar palabras random.Number = Math.round(Math.random)*(ArrayPalabras.length-1); seleccionPalabra = ArrayPalabras[random.Number]; borrarLet = seleccionPalabra.length; // Parar seleccionPalabra e introducir palabra en el arrayEnc for(var i:Number = 0;i<seleccionPalabra.length; i++){ Array._Enc(i) = seleccionPalabra.charat(i); } //iniciar array arrayNoEnc para el juego // mostrar el character for(vari:Number = m;i<seleccionPalabra.length;i++){ arrayNoEnc[i] = "?"; interface._mc.display._txt.text+ = "?"; } } interface_mc.enter_btn.onRelease = function(){ malas = true; interface._mc.display._txt.text = ""; for(var i:Number = 0;i<seleccionPalabra.length;i++) letraEnc = arrayEnc[i] == interface_mc.input_txt.text; noEncontrada = arrayNoEnc[i]! = interface_mc.input_txt.text; if(letraEnc && noEncontrada){ //buscar palabras no encontradas en el array malas = false; borrarLet--; arrayNoEnc[i] = interface._mc.input._txt.text; } interface._mc.display._txt.text+ = arrayNoEnc[i]; } //reset input text interface._mc.input._txt.text = ""; if(malas && noEncontrada){ ahorcado_mc.nextFrame(); if(ahorcado_mc._currentframe = 10){ //GAME OVER!! interface_mc._visible = false; iniciarJuego_btn._visible = true; } } if(borrarLet == 0){ //GAME WIN!! ahorcado_mc.gotoAndStop("ganar"); interface_mc._visible = false; iniciarJuego_btn._visible = true; } // Codogo principal de inicializacion-se ejecuta cuando la pelicula comienza // iniciar arrays de palabras var arrayPalabras:Array = newArray ["guitarra","bajo","bateria","concierto","organeta","pedalera","dragon","heavy metal","fuego","espada","guerrero","rock","poder","sexo","martillo","sangre"]; //iniciar arrays de letras var arrayEnc:Array = newArray(); var arrayNoEnc:Array = newArray(); //iniciar variables var randomNumber:Number = 0; var seleccionPalabra:String = ""; var borrarLet:Number = 0; var letraEnc:Boolean = false; var noEncontrada:Boolean = false; var malas:Boolean = false; //Ocultar la interfaz de juego interface_mc._visible = false; // Detener la pelicula y el clip de pelicula ahorcado_mc ahorcado_mc.stop(2); stop(0);
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 16: Left side of assignment operator must be variable or property.
Array._Enc(i) = seleccionPalabra.charat(i);
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 23: Interfaces may only be defined in external ActionScript 2.0 class scripts.
interface._mc.display._txt.text+ = "?";
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 28: Interfaces may only be defined in external ActionScript 2.0 class scripts.
interface._mc.display._txt.text = "";
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 31: Syntax error.
noEncontrada = arrayNoEnc[i]! = interface_mc.input_txt.text;
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 37: Operator '=' must be followed by an operand
arrayNoEnc[i] = interface._mc.input._txt.text;
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 39: Interfaces may only be defined in external ActionScript 2.0 class scripts.
interface._mc.display._txt.text+ = arrayNoEnc[i];
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 43: Interfaces may only be defined in external ActionScript 2.0 class scripts.
interface._mc.input._txt.text = "";
**Error** Scene=Escena 1, layer=Codigo, frame=1:Line 84: Wrong number of parameters; stop requires exactly 0.
stop(0);
Total ActionScript Errors: 8 Reported Errors: 8