Foros del Web » Creando para Internet » Flash y Actionscript »

Ayuda con la clase AnimTween

Estas en el tema de Ayuda con la clase AnimTween en el foro de Flash y Actionscript en Foros del Web. Buenos días soy un poco principiante en eso del actionscript y tengo un problema ke me trae de cabeza a ver si alguno de vosotros ...
  #1 (permalink)  
Antiguo 17/11/2008, 09:59
 
Fecha de Ingreso: agosto-2004
Mensajes: 3
Antigüedad: 19 años, 8 meses
Puntos: 0
Ayuda con la clase AnimTween

Buenos días soy un poco principiante en eso del actionscript y tengo un problema ke me trae de cabeza a ver si alguno de vosotros me puede ayudar. Resulta que tengo una clase animtween y al generar el swf me da el siguiente error:

1084: Error de sintaxis: se esperaba identifier antes de this.

el codigo es este y el error me da en la linea que esta en rojo. alguien me puede ayudar.

muchas gracias

CODIGO:

class AnimTween
{
var myString, Name_array, Change_array, Begin_array, this.Name_array[i], onEnterFrame, Value_array;
function AnimTween()
{
} // End of the function
function easeNone(t, b, c, d)
{
return (c * t / d + b);
} // End of the function
function easeInElastic(t, b, c, d, a, p)
{
if (t == 0)
{
return (b);
} // end if
t = t / d;
if (t == 1)
{
return (b + c);
} // end if
if (!p)
{
p = d * 3.000000E-001;
} // end if
if (!a || a < Math.abs(c))
{
a = c;
var _loc7 = p / 4;
}
else
{
_loc7 = p / 6.283185E+000 * Math.asin(c / a);
} // end else if
t = t - 1;
return (-a * Math.pow(2, 10 * (t)) * Math.sin((t * d - _loc7) * 6.283185E+000 / p) + b);
} // End of the function
function easeOutElastic(t, b, c, d, a, p)
{
if (t == 0)
{
return (b);
} // end if
t = t / d;
if (t == 1)
{
return (b + c);
} // end if
if (!p)
{
p = d * 3.000000E-001;
} // end if
if (!a || a < Math.abs(c))
{
a = c;
var _loc7 = p / 4;
}
else
{
_loc7 = p / 6.283185E+000 * Math.asin(c / a);
} // end else if
return (a * Math.pow(2, -10 * t) * Math.sin((t * d - _loc7) * 6.283185E+000 / p) + c + b);
} // End of the function
function easeInOutElastic(t, b, c, d, a, p)
{
if (t == 0)
{
return (b);
} // end if
t = t / (d / 2);
if (t == 2)
{
return (b + c);
} // end if
if (!p)
{
p = d * 4.500000E-001;
} // end if
if (!a || a < Math.abs(c))
{
a = c;
var _loc7 = p / 4;
}
else
{
_loc7 = p / 6.283185E+000 * Math.asin(c / a);
} // end else if
if (t < 1)
{
t = t - 1;
return (-5.000000E-001 * (a * Math.pow(2, 10 * (t)) * Math.sin((t * d - _loc7) * 6.283185E+000 / p)) + b);
} // end if
t = t - 1;
return (a * Math.pow(2, -10 * (t)) * Math.sin((t * d - _loc7) * 6.283185E+000 / p) * 5.000000E-001 + c + b);
} // End of the function
function easeInCubic(t, b, c, d)
{
t = t / d;
return (c * (t) * t * t + b);
} // End of the function
function easeOutCubic(t, b, c, d)
{
t = t / d - 1;
return (c * ((t) * t * t + 1) + b);
} // End of the function
function easeInOutCubic(t, b, c, d)
{
t = t / (d / 2);
if (t < 1)
{
return (c / 2 * t * t * t + b);
} // end if
t = t - 2;
return (c / 2 * ((t) * t * t + 2) + b);
} // End of the function
function easeInQuint(t, b, c, d)
{
t = t / d;
return (c * (t) * t * t * t * t + b);
} // End of the function
function easeOutQuint(t, b, c, d)
{
t = t / d - 1;
return (c * ((t) * t * t * t * t + 1) + b);
} // End of the function
function easeInOutQuint(t, b, c, d)
{
t = t / (d / 2);
if (t < 1)
{
return (c / 2 * t * t * t * t * t + b);
} // end if
t = t - 2;
return (c / 2 * ((t) * t * t * t * t + 2) + b);
} // End of the function
function easeInExpo(t, b, c, d)
{
return (t == 0 ? (b) : (c * Math.pow(2, 10 * (t / d - 1)) + b));
} // End of the function
function easeOutExpo(t, b, c, d)
{
return (t == d ? (b + c) : (c * (-Math.pow(2, -10 * t / d) + 1) + b));
} // End of the function
function easeInOutExpo(t, b, c, d)
{
if (t == 0)
{
return (b);
} // end if
if (t == d)
{
return (b + c);
} // end if
t = t / (d / 2);
if (t < 1)
{
return (c / 2 * Math.pow(2, 10 * (t - 1)) + b);
} // end if
return (c / 2 * (-Math.pow(2, -10 * --t) + 2) + b);
} // End of the function
function easeInCircle(t, b, c, d)
{
t = t / d;
return (-c * (Math.sqrt(1 - t * t) - 1) + b);
} // End of the function
function easeOutCircle(t, b, c, d)
{
t = t / d - 1;
return (c * Math.sqrt(1 - (t) * t) + b);
} // End of the function
function easeInOutCircle(t, b, c, d)
{
t = t / (d / 2);
if (t < 1)
{
return (-c / 2 * (Math.sqrt(1 - t * t) - 1) + b);
} // end if
t = t - 2;
return (c / 2 * (Math.sqrt(1 - (t) * t) + 1) + b);
} // End of the function
function easeInBack(t, b, c, d, s)
{
if (s == undefined)
{
s = 1.701580E+000;
} // end if
t = t / d;
return (c * (t) * t * ((s + 1) * t - s) + b);
} // End of the function
function easeOutBack(t, b, c, d, s)
{
if (s == undefined)
{
s = 1.701580E+000;
} // end if
t = t / d - 1;
return (c * ((t) * t * ((s + 1) * t + s) + 1) + b);
} // End of the function
function easeInOutBack(t, b, c, d, s)
{
if (s == undefined)
{
s = 1.701580E+000;
} // end if
t = t / (d / 2);
if (t < 1)
{
s = s * 1.525000E+000;
return (c / 2 * (t * t * ((s + 1) * t - s)) + b);
} // end if
t = t - 2;
s = s * 1.525000E+000;
return (c / 2 * ((t) * t * ((s + 1) * t + s) + 2) + b);
} // End of the function
function easeInQuad(t, b, c, d)
{
t = t / d;
return (c * (t) * t + b);
} // End of the function
function easeOutQuad(t, b, c, d)
{
t = t / d;
return (-c * (t) * (t - 2) + b);
} // End of the function
function easeInOutQuad(t, b, c, d)
{
t = t / (d / 2);
if (t < 1)
{
return (c / 2 * t * t + b);
} // end if
return (-c / 2 * (--t * (t - 2) - 1) + b);
} // End of the function
function easeInQuart(t, b, c, d)
{
t = t / d;
return (c * (t) * t * t * t + b);
} // End of the function
function easeOutQuart(t, b, c, d)
{
t = t / d - 1;
return (-c * ((t) * t * t * t - 1) + b);
} // End of the function
function easeInOutQuart(t, b, c, d)
{
t = t / (d / 2);
if (t < 1)
{
return (c / 2 * t * t * t * t + b);
} // end if
t = t - 2;
return (-c / 2 * ((t) * t * t * t - 2) + b);
} // End of the function
function easeInSine(t, b, c, d)
{
return (-c * Math.cos(t / d * 1.570796E+000) + c + b);
} // End of the function
function easeOutSine(t, b, c, d)
{
return (c * Math.sin(t / d * 1.570796E+000) + b);
} // End of the function
function easeInOutSine(t, b, c, d)
{
return (-c / 2 * (Math.cos(3.141593E+000 * t / d) - 1) + b);
} // End of the function
function tween(MCname, NArray, VArray, Duration, tweenType, floatAction, args)
{
var refName = eval(MCname);
refName.Name_array = NArray.split(",");
refName.Value_array = VArray.split(",");
var myLength = refName.Value_array.length;
this.myString = "";
var i = 0;
while (i < myLength)
{
this.myString = this.myString + (refName[refName.Name_array[i]] + ",");
++i;
} // end while
refName.Begin_array = this.myString.split(",");
refName.Begin_array.pop();
this.myString = "";
var i = 0;
while (i < myLength)
{
this.myString = this.myString + (String(refName.Value_array[i] - refName[refName.Name_array[i]]) + ",");
++i;
} // end while
refName.Change_array = this.myString.split(",");
refName.Change_array.pop();
var t = 0;
var d = Duration;
var b = 0;
var c = 500;
refName.onEnterFrame = function ()
{
++t;
var i = 0;
while (i < myLength)
{
this[this.Name_array[i]] = _level0.Tween[tweenType](t, Number(this.Begin_array[i]), Number(this.Change_array[i]), d);
++i;
} // end while
if (t > d)
{
delete this.onEnterFrame;
var i = 0;
while (i < myLength)
{
this[this.Name_array[i]] = this.Value_array[i];
++i;
} // end while
delete this.Name_array;
delete this.Value_array;
delete this.Begin_array;
delete this.Change_array;
if (floatAction != undefined)
{
eval("[floatAction](args)");
} // end if
} // end if
};
} // End of the function
} // End of Class
  #2 (permalink)  
Antiguo 17/11/2008, 10:28
Avatar de jahepi
Colaborador
 
Fecha de Ingreso: diciembre-2004
Ubicación: Querétaro
Mensajes: 1.124
Antigüedad: 19 años, 4 meses
Puntos: 43
Respuesta: Ayuda con la clase AnimTween

Hola magistr !

Te recomiendo que mejor utilices otra clase para hacer animaciones llamada TweenLite, uno de los muchos puntos a favor es que tiene documentación así que no vas a batallar mucho para realizar lo que quieres.

Versión para Actionscript 2.0: TweenLite
Versión para Actionscript 3.0: TweenLite

También hay otras clases del mismo grupo de desarrollo como TweenFilterLite, TweenformManager, TweenGroup y TweenMax que cuentan con más funcionalidades, puedes checarlas en las páginas que te pase, vienen en el apartado de 'top classes'.

Un saludote !
__________________
Una contraseña es como la ropa interior. No deberías dejarlas afuera a la vista de otras personas, deberías cambiarla regularmente, y ni se te ocurra prestarla a extraños.
  #3 (permalink)  
Antiguo 17/11/2008, 15:14
 
Fecha de Ingreso: agosto-2004
Mensajes: 3
Antigüedad: 19 años, 8 meses
Puntos: 0
Respuesta: Ayuda con la clase AnimTween

Gracias jahepi, si pego el codigo en la clase twenlite me rulara????
  #4 (permalink)  
Antiguo 17/11/2008, 17:29
Avatar de jahepi
Colaborador
 
Fecha de Ingreso: diciembre-2004
Ubicación: Querétaro
Mensajes: 1.124
Antigüedad: 19 años, 4 meses
Puntos: 43
Respuesta: Ayuda con la clase AnimTween

Cita:
Iniciado por magistr Ver Mensaje
Gracias jahepi, si pego el codigo en la clase twenlite me rulara????
Hola Magistr !

No tienes que pegar ese código en la clase, solamente utiliza la clase TweenLite, lee la documentación para que aprendas a utilizarla.

Un saludote !
__________________
Una contraseña es como la ropa interior. No deberías dejarlas afuera a la vista de otras personas, deberías cambiarla regularmente, y ni se te ocurra prestarla a extraños.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:30.