samedi 17 décembre 2016

I need time limit help in ActionScript3.0

I am working on a time limit game, but when I load the game and it passes the time limit that is placed it reaches zero but it is not directed to the next scene where I have the game over .. this is the code that is placed

var tiempo:int;
var Duracion:int;

Duracion = 7;
tiempo = Duracion;
var timer:Timer = new Timer(1000,Duracion);
timer.addEventListener(TimerEvent.TIMER, tiempo2);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, fin)

function tiempo2(tiempoevent:TimerEvent):void


    time.text = tiempo.toString();


function fin(tiempoevent:TimerEvent):void
    var timer:Timer = as Timer;
    timer.removeEventListener(TimerEvent.TIMER, tiempo2)
    timer.removeEventListener(TimerEvent.TIMER, fin)


Como hago para que se direccione a la Escena de game over... lo estoy trabajando en animate cc...

Aucun commentaire:

Enregistrer un commentaire