I am still unable to achieve the validation.
Nothing happens when I click on the button.
Even empty fields should bring me to wrongTryAgain frame right? But nothing happens...
Here is what I did:
To make things really simple, I created a new file with 3 layers: Labels, Actions, Content
LAYER 1: I have named the 3 key frames with these labels: start, correctProceed, wrongTryAgain
LAYER 2: Action layer contains this code:
-----------------------------------------------------------------------------------------
var root = this;
function validateF(){
if($("#answer1").val()=="123" && $("#answer2").val()=="234"){
// correct
root.gotoAndStop("correctProceed");
} else {
// incorrect
root.gotoAndStop("wrongTryAgain");
}
}
this.start.addEventListener("click", this.validateF);
-----------------------------------------------------------------------------------------
LAYER 3: Content layer contains 2 TextInput components named "answer1" & "answer2" and a Start button named "start". The key frames of correctProceed & wrongTryAgain has Ok & Wrong static text.
Can you advice what I am doing/not doing correctly please? Thank you!
use:
this.start.addEventListener("click", validateF);