Hi! Im new here. I have 2 textboxes. T1 and T2.
If I type a number in T1, it will automatically add +10 and flash in T2
Ex. 2 - 12
listenForEnterObject = new Object();
listenForEnterObject.onKeyUp=function(){
voca_pg2.text=parseInt(voca_pg1.text)+10
}
Key.addListener(listenForEnterObject);
My question is, what to do if I want to type in textbox2 and nothing will happen in T
Ex. if I type 4 to textbox1, textbox2 will become 14 right.
I want to edit 14 and change it to 5 so it would look like:
4 - 5
I’ve tried
voca_pg2.onSetFocus = function(oldFocus) {
Key.removeListener(listenForEnterObject);
}
but I need to use listenForEnterObject again later again so removing it is not a good idea.
Plus I have a back and next button
button1.onPress = function() {
voca_pg1.text=parseInt(voca_pg1.text)-10
voca_pg2.text=parseInt(voca_pg2.text)-10
};
button2.onPress = function() {
voca_pg1.text=parseInt(voca_pg1.text)+10
voca_pg2.text=parseInt(voca_pg2.text)+10
};
it looks like 10 - 20
20 - 30
How do I make it block so it would not pass negative numbers when they click back button a lot?
Help and suggestions are greatly appreciated. Thank you.