I try to implement a simple function to input a variable from the user with this code:
local textBox
local function inputListener( event )
if event.phase == “ended” then
return
elseif event.phase == “editing” then
print( event.text )
end
end
textBox = native.newTextField( 15, 70, 280, 70 )
textBox.text = “default text”
textBox:addEventListener( “userInput”, inputListener )
local input = textBox.text
print( "input = " … input )
the code is executed with no pause and print input = default text
in the simulator i can modify the text but can’t get the ended phase