Hello,
I’m trying to figure out the userInput feature of Corona and am starting by trying to build a very simple app that does this:
1 - Display text field
2 - Type in something and hit enter
3 - Entered text shows up on the screen.
I’m not having luck with this code (below). I get the following error:
WARNING: Attempting to set property(text) with nil
[code]
local text = display.newText("",250,150,nil,26)
local function textListener( event )
–print( event.text )
if event.phase == “submitted” then
text.text = event.text
end
end
– Create our Text Field
defaultField = native.newTextField( 10, 30, 180, 30 )
defaultField:addEventListener( “userInput”, textListener )
[/code] [import]uid: 141560 topic_id: 33655 reply_id: 333655[/import]