I have two buttons one that adds 2 and one that adds 3.
score.text = 0;
add2.onPress = function():Void {
score.text = Number(score.text) + 2;
};
add3.onPress = function():Void {
score.text = Number(score.text) + 3;
};
I want to gotoAndPlay to another frame with the value adds to 5. Say if I press the add2 button and the add3 button, I want to go to another frame.
I tried making score.text a variable and it didn’t work.
If (score.text =5){
gotoAndPlay(1);
}
Is what I tried and nothing worked.
Any help please?