Passing native textfield text value to another lua page

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!

I use storyboard, so I can store the string in a storyboard variable i.e.

storyboard.var = editField.text

Then I can use this variable throughout my app, but I am not familiar with Director. I don’t know if you can do this.

In this line:  director.changeScene(“search_result”, “crossfade”) does director allow you send params to your next scene?

It is also possible to do it this way too with storyboard

I use storyboard, so I can store the string in a storyboard variable i.e.

storyboard.var = editField.text

Then I can use this variable throughout my app, but I am not familiar with Director. I don’t know if you can do this.

In this line:  director.changeScene(“search_result”, “crossfade”) does director allow you send params to your next scene?

It is also possible to do it this way too with storyboard