lundi 27 février 2017

Actionscript quiz game using adobe animate

Hi im new to actionscript and I and my classmates are making a quiz game using adobe animate. What i want to happen is when a user tap the checkbutton the checkbutton will check if the the answer that the user inputted in the textbox is correct or wrong. When the Answer matched the correct answer it will go to the next page which is frame3 and when it is wrong it will only stay in its currentframe. the problem is even when the answer that is inputted is correct and it matched with the right answer it wont proceed to the other frame it will always stay in its currentframe, as if like the if(textbox.text == "correctanswer") is ignored. I hope you can help me :) Thanks in Advance

checkbutton_2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopFromFrame_2);

function fl_ClickToGoToAndStopFromFrame_2(event:MouseEvent)
{
    if(textbox.text == "correctanswer"){
        gotoAndStop(3);
      }else{
        gotoAndStop(2);
    }
}

Aucun commentaire:

Enregistrer un commentaire