Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/05/2009, 15:35
curaparroco
 
Fecha de Ingreso: febrero-2009
Mensajes: 30
Antigüedad: 15 años, 3 meses
Puntos: 0
Respuesta: ActionScript. Diferencia de versiones?

Hola. Vuelvo con el tema.
Este es el código que quiero cambiar de versión
Cita:
Math.sind = function (theta) { return Math.sin(theta*Math.PI/180) }
Math.cosd = function (theta) { return Math.cos(theta*Math.PI/180) }
Math.atan2d = function (y, x) { return Math.atan2(y, x)*180/Math.PI }
Math.dist = function (a, b) { return Math.sqrt((a*a) + (b*b) ) }
Math.r3 = function (a, b){ return b * 100 / a }


MovieClip.prototype.tresD3 = function ( angleXY, ratioXY, angleXZ , ratioXZ, id ){
za = Math.sind(angleXZ) * ratioXZ
zT = 600 + (za * 2)
zb = ( zT < 1 ) ? 1 : zT
_x = (Math.cosd(angleXY) * ratioXY) + (Math.cosd(angleXZ) * ratioXZ)
_y = Math.sind(angleXY) * ratioXY
_xscale = zb
_yscale = zb
depth = (int( _xscale * 100 ) * 100 ) + id
this.swapDepths ( depth )
}
junto con este
Cita:
onClipEvent(load){
Obj._visible=0
num = 9
f = 0.9
r = 0.06
w = 900
h = 780
for ( i = 1 ; i <= num ; i++ ){
Obj.duplicateMovieClip ( "b" + i , i )
b = this ["b" + i]
b.id = i
b.angleXY = random(360)
b.ratioXY = 50
b.angleXZ = random(360)
b.ratioXZ = 50
b.tresD3( b.angleXY, b.ratioXY, b.angleXZ, b.ratioXZ, id )
}
}

onClipEvent(enterFrame){
x = (Math.r3 (w, _root._xmouse) - 50) / 10
y = (Math.r3 (h, _root._ymouse) - 50) / 10
for ( i = 1 ; i <= num ; i++ ) {
b = this["b" + i]
b.angleXZ += x
b.angleXY += y
b.tresD3( b.angleXY, b.ratioXY, b.angleXZ, b.ratioXZ, id )
}
}
ambos forman parte de un algoritmo encargado de multiplicar un circulo en la pantalla y hacerlos orbitar aleatoriamente. Parte de esa aleatoriedad es determinada por el puntero del mouse.
Esto funciona en Flash 5 con ActionScript 1 y yo necesito que funcione en Flash 8 y Actionscript 2. Me pueden ayudar a cambiarlo?

Agradezco cualquier manito que me puedan dar