I’m trying to detect if a number or letter was typed.
And if a letter was type, an alert would pop up.
Is there a way to do this?
Thank you!
here’s my beginner’s attempt with error messages… =0/
[code]
local numbersTyped = {1,2,3,4,5,6,7,8,9,0}
local function letterTypedAlert( event )
if numbersTyped = myField.text then
print (“yes, numbers are good”)
else
print(“Please key in a number.”)
end
end
myField = native.newTextField( 10, 10, 180, 30 )
myField:addEventListener( “userInput”, letterTypedAlert )
myField.text = “0”
[/code] [import]uid: 169633 topic_id: 32287 reply_id: 332287[/import]