Comunidad de diseño web y desarrollo en internet online

como asignar eventos a un clip atacheado

Citar            
MensajeEscrito el 31 Ene 2007 05:43 pm
Hola a todos bueno mi pregunta es como asignar este evento explicado abajo en el codigo a un clip de pelicuala colocado en el escenario mediante attachMovie... Ya me duele la Cabeza

Código :

// colocamos el clip marc que esta en la biblioteca en el escenario mediadiante attachMovie 
boto.attachMovie("marco","marc",1);

//el evento que quiero agregarle es este...
 :( 
onClipEvent (enterFrame) {
   boto.marc.onRollOver=function(){
      _root.cont.efec1.onEnterFrame = function () {
                 if (this._currentframe != 10) {
                        this.nextFrame();
                }
                else {
                        this.stop();
                        delete this["onEnterFrame"];
                } // end if
        };
   }
   updateAfterEvent();
}


unas ideas please :( ya me dan ganas de destrozar mi pc :|

Por DanielHR

56 de clabLevel



Genero:Masculino  

Hoy hasta 100pre no hay marcha atras

msie
Citar            
MensajeEscrito el 31 Ene 2007 08:44 pm
cre que es algo asi + o -

contador =0
onEnterFrame = function(){
clip=this.attachMovie("burbuja", "burbuja"+contador, contador++)

}

Por Poliformic

5 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 01 Feb 2007 05:51 pm
Eso se hace con prototipos. No es muy complicado, definís un prototipo como una función. Luego, lo ejecutás del mismo modo que ejecutarías una función.

Código :

MovieClip.prototype.comportamientoBoton = function () {
this.onPress = function () {
trace ("Botón presionado");
};
};
this.attachMovie ("Boton", "Boton1", 1);
boton1.comportamientoBoton ();


Incluso, se le pueden pasar parámetros (si, los prototipos son funciones comunes y corrientes):

Código :

MovieClip.prototype.comportamientoBoton = function (numero:Number) {
this.onPress = function () {
trace ("Has presionado el boton " + numero);
};
};
for (i = 1; i <= 5; i++) {
this.attachMovie ("Boton", "boton" + i, i);
_root["boton" + i].comportamientoBoton (i);
_root["boton" + i]._x = Math.random * Stage.width;
_root["boton" + i]._y = Math.random * Stage.height;
}

Por HernanRivas

Claber

3416 de clabLevel

26 tutoriales

 

Argentina

msie

 

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