Estaba el otro dia fisgando código de cristalab i dí con un menú precioso rotatorio con efectos de 3D, lo estube modificando i jugando con él... Pero tengo un problemón, solo me compila en modo Flash 6 i AS 1.0... i mi juego funciona sobre Flash 8 con AS 2.0 y no se como traducirlo
Alguien podria ayudar-me??
PD: el archivo entero está aquí: http://www.cristalab.com/ejemplos/menu-con-elementos-tridimensional-giratorios-c30l/
Código ActionScript :
//proto q movera las letras
MovieClip.prototype.carusel = function(mover, posicionFinal)
{
mueveAngulo(posicionFinal);
if (mover)
{
this.onEnterFrame = function() {
this._x = centrox+Math.cos((Math.PI/180)*(angulo+this.angulo))*radio;
this._y = centroy+Math.sin((Math.PI/180)*(angulo+this.angulo))*radio/-20;
this.z = Math.sin((Math.PI/180)*(angulo+this.angulo))*radio;
this._alpha = this._yscale=this._xscale=(100*distanciafocal)/(distanciafocal+this.z);
this.swapDepths(-1*this.z);
}
} else {
delete this.onEnterFrame;
}
};
function mueveAngulo(posicionFinal) {
this.onEnterFrame = function() {
if ((Math.round(angulo)) == Math.round(posicionFinal)) {
mueveLetras(false);
delete this.onEnterFrame;
} else {
//contador de frames
if (counter++%30 == 1) {
// updates every 30 frames
thisTime = getTimer();
rate = Math.round(10000/(thisTime-lastTime))/10;
if (rate%1 == 0) {
rate += ".0";
}
} else if (counter%30 == 1) {
lastTime = getTimer();
}
angulo += ((posicionFinal-angulo)/30);
}
};
}
//para ir sumando la profundidad
function maxprofundidad() {
return ++profundidad;
}
//inicio variables
centrox = 700/2;
centroy = 200;
radio = 220;
distanciafocal = 350;
//creando los titulos
titulos = "Jugar Instrucciones Opciones ";
//creando los clips q contendran las letras
function creaLetras() {
letras = new Array();
for (i=0; i<=titulos.length; i++) {
letras[i] = titulos.substr(i, 1);
var letra = this.attachMovie("letrita", "letrita"+i, maxprofundidad());
letra.angulo.i = i;
letra.angulo = (360/titulos.length)*i;
letra.contenido.text = letras[i];
letra.carusel(true, 249);
//trace(letra);
}
}
creaLetras();
function mueveLetras(mover, posicionFinal) {
for (i=0; i<=titulos.length; i++) {
this["letrita"+i].carusel(mover, posicionFinal);
}
}
b1.onPress = function() {
mueveLetras(true, 252);
};
b2.onPress = function() {
mueveLetras(true, 130);
};
b3.onPress = function() {
mueveLetras(true, -5);
};
stop();
Muchísimas grácias por adelantado!!
