Content of textField will be variable

Hello,

I have a textField on which user can type his nickname. (On next function it will be send to server with score). My question is: How can I make a variable content of textField? (e.g. local nickname = content of textfield). Thanks in advance!

\_W = display.viewableContentWidth \_H = display.viewableContentHeight local background = display.newRect (220, 150, \_W, \_H) background.isVisible = false local lblFirstName = display.newText ( "Podaj swój nick:", 170, 140, native.systemFont, 28 ) local lblFirstName2 = display.newText ( "(Będzie on używany do publikowania wyników)", 170, 180, native.systemFont, 16 ) local txtFirstName = native.newTextField( 170 , 230, 240, 50 ) txtFirstName.size = 38 txtFirstName:addEventListener( "userInput", txtFirstName) local lblFeedback = display.newText( "", 140, 100, native.systemFont, 28 ) function txtFirstName:userInput(event) if event.phase == "began" then event.target.text = ' ' lblFeedback.text = "waiting" elseif event.phase == "ended" then lblFeedback.text = "Thank you" .. " " .. event.target.text elseif event.phase == "submitted" then lblFeedback.text = "Hell" .. " " .. event.target.text elseif event.phase == "editing" then lblFeedback.text = event.startPosition end end function background:tap ( event ) native.setKeyboardFocus ( nil ) end background:addEventListener("tap", background)

local nickname = txtFirstName.text

local nickname = txtFirstName.text