Comunidad de diseño web y desarrollo en internet online

Autoclick

Citar            
MensajeEscrito el 10 May 2008 07:25 pm
1. ¿hay alguna forma de darle click a un boton desde un método? algo así como un autoclick

2. ¿porque no puedo usar métodos que están dentro de una misma clase por ejemplo :oops:

class hola{
function esto(){
trace(\"Hola\");
otro();
}
function otro(){
trace(\"mundo\");
}
}

Mcuhas gracias por su atención.[/flash][/code]

Por Tochtli

1 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 11 May 2008 01:11 pm
En el AS 2 de flash:

Código :

boton.onRelease = function(){
   trace("click en el boton");
}

var instancia_hola:hola = new hola(this);
instancia_hola.esto();



La clase, guardada en el mismo directorio.

Código :

class hola{
   private var base:MovieClip;
   function hola(b:MovieClip){
      this.base = b;
   }
   function esto(){ 
      trace("Hola");
      this.otro();
   }
   function otro(){
      trace("mundo");
      this.base.boton.onRelease();
   }
}

Archivos fuente:
http://rapidshare.com/files/114131210/test_class.zip.html

Por micheloud

341 de clabLevel



 

Misiones, Argentina

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.