mardi 1 août 2017

Can I match the "Elegir1" button with the image that randomly exits the "persoanje 1" + T function when making a good choice, display a message?

DiabloB.addEventListener(MouseEvent.CLICK,Elegir1)

this.addEventListener(Event.ENTER_FRAME, Caida)


function Caida(e: Event) {
    T++
    if (T == 10) {
        T = (Math.random() * 4 + 1)

//this is the random IMG "Personaje 1, Personaje 2 , Personaje 3 , Personaje 4"

        refClass = getDefinitionByName("Personaje " + T) as Class;
        ref = new refClass()
        ref.y = -250
        addChild(ref)
        T = -500
        enemigos.push(ref)
        trace(enemigos.length)
        setTimeout(function () {
            removeChild(ref);
        }, 20500);
    }
}

// this is the button

function Elegir1(e: MouseEvent) {

}




Aucun commentaire:

Enregistrer un commentaire