Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/11/2009, 06:47
Serezade81
 
Fecha de Ingreso: noviembre-2009
Ubicación: Madrid
Mensajes: 81
Antigüedad: 14 años, 6 meses
Puntos: 1
Exclamación Animacion Flash as3

Hola a ver si me podeis echar un clable con este codigo de as3, porque no consigo saber lo que esta fallando, me da el error "1084: Error de sintaxis: se esperaba rightbrace antes de end of program."
He modificado un codigo que tenia de otra animación que ya funcionaba, he cambiado el moviclip, he hecho uno diferente y he aumentado el tamaño del escenario. Con lo cual he cambiado el nombre de la función.
Bueno a ver si alguien le hecha un ojo al codigo y me dice que esta mal.
Muchas Gracias.

Codigo AS 3.0

Código:
for (var i:uint = 0; i<1100; i++) {
	var star:MovieClip=new estrella();
	addChild(star);

	star.y=uint(Math.random()*768);
	star.x=uint(Math.random()*1024);
	star.alpha=.3+Math.random();
	star.scaleX=star.scaleY=Math.random();

	star.addEventListener(Event.ENTER_FRAME, mueve);
}
function mueve(e:Event):void {
	e.currentTarget.y+=Math.random()*10;
	e.currentTarget.x+=1-Math.random()*2;
	e.currentTarget.alpha-=.002;

	if (e.currentTarget.y>768) {
		e.currentTarget.y=0;
		e.currentTarget.alpha=.3+Math.random();
		
	if (e.currentTarget.x>1024) {
		e.currentTarget.x=0;
		e.currentTarget.alpha=.2+Math.random();

	}
}