Comunidad de diseño web y desarrollo en internet online

Girar movieclip en dos sentidos

Citar            
MensajeEscrito el 07 Feb 2007 08:49 pm
Hola a todos, necesito un favor el siguiente codigo es un movie clip que tiene dos botones uno lo hace girar en una direccion y el otro en la otra direccion:

Código :

rotar = function (sentido) {
   if (sentido == 1) {
      cuadro_mc.onEnterFrame = function() {
         cuadro_mc._rotation += 10;
      };
   } else if (sentido == 2) {
      cuadro_mc.onEnterFrame = function() {
         cuadro_mc._rotation -= 10;
      };
   }
};
relojPositivo.onRelease = function() {
   rotar(1);
};
relojNegativo.onRelease = function() {
   rotar(2);
};

Mi pregunta es se puede acortar mas este codigo???
se puede asignar directamente la funcion creada y enviarle el parametro, gracias por la ayuda:
relojNegativo.onRelease = rotar(2);


[zah]Usa las etiquetas code para postear código[/zah]

Por Arcano28

1 de clabLevel



 

firefox
Citar            
MensajeEscrito el 07 Feb 2007 08:59 pm

Código :

relojPositivo.rotacion=10
relojNegativo.rotacion=-10
relojPositivo.onRelease=relojNegaivo.onRelease=function(){
cuadrado_mc.rotacion=this.rotacion
}
cuadro_mc.onEnterFrame = function() {
this._rotation += this.rotacion;
};

Por Zah

BOFH

4290 de clabLevel

27 tutoriales
5 articulos

  Bastard Operators From Hell Editores

Zaragoza, España

firefox

 

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