I know that Ansca updated their API’s since when I set up my newTextField via the old way I did it, it said this system is outdated. It now tells me that I should use object:addEventListener. Can someone instruct me why this isn’t working?
[lua]function new()
local localGroup = display.newGroup()
local background = display.newImage(“background.png”)
localGroup:insert(background)
local enterUser = display.newEmbossedText(“Enter User Name:”, _W/9 - 15, 95, native.systemFont,50, {0,0,0,200})
enterName = native.newTextField( 50,150,500,60,hello)
local function save_name(text)
sfg = display.newEmbossedText(enterName, _W/9 - 15, _H/2, native.systemFont,50, {0,0,0,200})
asdf =display.newEmbossedText(enterName.text, _W/9 - 15, _H/1.2, native.systemFont,50, {0,0,0,200})
timer.performWithDelay(5000,changeScene,1)
end
local function changeScene()
director:changeScene(“menu”)
end
enterName:addEventListener(“submitted”, save_name)
return localGroup
end[/lua]
What I want to happen is for the text you enter to be displayed on the screen. Can someone please help? Thanks!
Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 23225 reply_id: 323225[/import]
[import]uid: 52491 topic_id: 23225 reply_id: 92951[/import]