mardi 28 juin 2016

Int variable not changing

I'm trying to increment my int variable i when a button is pressed. However, it's not working.

var i:int = 0;

DB_47_ENTER_ROOM105.addEventListener(MouseEvent.CLICK, DB_47_ENTER_ROOM105_Action);

function DB_47_ENTER_ROOM105_Action(event:MouseEvent):void {
    trace(i);
    if (i == 0) {
        gotoAndStop(49);
        i = 1;
    }

    if (i == 1) {
        gotoAndStop(50);
    }
}

Aucun commentaire:

Enregistrer un commentaire