Ciao a tutti, sto creando un movieclip che si sposta per lo schermo, quando raggiunge il bordo dello stage dovrebbe invertire direzione. ...ovviamente non accade

addEventListener(Event.ENTER_FRAME, bounceStar);

function bounceStar(e:Event):void {
var bounceX:Number = 2;
var bounceY:Number = 3;
if (bounce_star.x < stage.stageWidth) {
bounce_star.x += bounceX;
bounceX_txt.text = String(bounceX);
} else {
bounceX *= -1;
}

if (bounce_star.y < stage.stageHeight) {
bounce_star.y += bounceY;
} else {
bounceY *= -1;
}
}

grazie x l'aiuto! )