Comunidad de diseño web y desarrollo en internet online

Tengo un código que funciona en as2 y quiero pasarlo a as3

Citar            
MensajeEscrito el 06 Ene 2010 07:09 pm
Hola tengo una código que funciona en as2 y quiero el equivalente en as3.

Sobre un clip de película, en as2 he escrito este código para hacerlo rotar y funciona bien.

Código ActionScript :

onClipEvent(enterFrame){
this._rotation++;
}


luego intento hacer lo mismo en as3, sobre un clip de película, escrito este código que compila bien, pero no hace nada, es decir no rota como lo hace en as2:

Código ActionScript :

addEventListener(Event.ENTER_FRAME, rotar);

function rotar(e:Event):void {
   this._rotation++;
}


Algo habré hecho mal en el código de as3, para que no funcione.

Un saludo y gracias de antemano.

Por Dav1d

14 de clabLevel



 

firefox
Citar            
MensajeEscrito el 06 Ene 2010 07:17 pm
sacale el "_" al rotation.
te tiene que quedar this.rotation++;

Saludos

Por GustavoV

Claber

136 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 06 Ene 2010 11:31 pm
el "_" desaparecio en las propiedades para AS3, debe haber alguna excepcion, pero no me acuerdo en el momento :P,
las propiedades maaaas comunes quedarian asi:

Código ActionScript :

//AS2           AS3
obj._xscale   =    obj.scaleX
obj._yscale   =    obj.scaleY
obj._x          =    obj.x
obj._y          =    obj.y
obj._rotation=    obj.rotation
                        obj.rotationX //solo CS4
                        obj.rotationY //solo CS4
                        obj.rotationZ //solo CS4
obj._width   =     obj.width
obj._height  =     obj.height


etc etc etc.
Hasta Luego! :D

Por hormy1

Claber

124 de clabLevel



 

firefox

 

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