Question

I'm not getting any errors, but i'm making a trivia game (Specifically a free answer section) In the stage, there is an input textbox, and a button. I'm trying to make it so that a user could type in an answer on it and submit it. The answer, in this case, is 4, and if the student types in 4 and clicks submit, it'll jump to frame 3. If they put something other than four, then it will go to frame 23, aka, the "You lose" frame. Is there anything I should change?

function handleClick(pEvent:MouseEvent):void {
    if (fouryears.text == "4") {
        gotoAndStop(3);
     } else {
        gotoAndStop(23);
     }
}
submitbtn.addEventListener(MouseEvent.MOUSE_UP, handleClick);

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top