My code is not working properly. The subtracting thing should only work if the text is 1 or higher.
Could somebody help me:
button1.onPress = function() {
if (voca_pg1.text > 0){
voca_pg1.text=parseInt(voca_pg1.text)-10
voca_pg2.text=parseInt(voca_pg2.text)-10
}
else if (voca_pg1.text < 0){
voca_pg1.text = "1"
voca_pg2.text = "11"
}
};
When I click the button it goes -9 - -11
then when I click again it goes back to what I want 1 - 11