Código :
function main ():void
{
for (var z:int=z; z<=numinstancias; z++)
{
var timer1:Timer=new Timer(1);
var instancia:int=evaluadistancia();
this.instancia.text=instancia;
timer1.addEventListener (TimerEvent.TIMER,mover);
timer1.start ();
}
}
// Evento que mueve el clip
function mover (event:TimerEvent):void
{
var t:triangulo=new triangulo();
t=getChildByName("triangulo"+this.instancia.text);
if (t.numero.visible==true)
{
if ( t.hitTestObject( this.n ))
{
// lo marca con una señal
t.numero.visible=false
;
// destruye el timer
timer1.removeEventListener(TimerEvent.TIMER,mover)
//timer1.stop();
}
else
{
if (this.n.x >= t.x )
{
coord = "x";
dir = -1;
}
if (this.n.y>= t.y)
{
coord = "y";
dir = -1;
}
if (this.n.x < t.x)
{
coord = "x";
dir = 1;
}
if (this.n.y < t.y)
{
coord = "y";
dir = 1;
}
this.n[coord] += vel*dir;
}
}
}
Por favor si alguien me podria decir por que y como solucionarlos.....muchas gracias
