Hi Corona Team,
I would like to ask about passing the text value of native.textfield to another lua page. My code snippets are here:
search_game.lua:
searchField = native.newTextField( 10, 150, display.contentWidth - 20, 36 )
searchField.font = textFont
searchField.size = 14
searchField.text = “roi”
gameKeyword = searchField.text
function searchNowBtnPress(event)
print (“text2”)
print (gameKeyword)
native.setKeyboardFocus( nil )
director.changeScene(“search_result”, “crossfade”)
return true
end
search_result.lua:
module(“search_game”, package.seeall)
module(“search_result”, package.seeall)
require “search_game”
gameKeyword = search_game.gameKeyword
print (gameKeyword)
– gameKeyword prints on the search_game.lua page but it becomes nil on the search_result.lua
how to pass the value of textfield? i used the same method of variable passing and it is successful. I just got a problem when the value coms from native.textfield.
Thanks!