I know this will turn out to be something silly but I am trying to store the new text input in a variable to print elsewhere I cant seem to get the variable to exist outside of the widget. In my example I have posted newtesxinside prints the inputed text but newtextoutside is nil
What simple thing am I missing here.
[code].GUI = require(“widget_candy”)
– LOAD A THEME
_G.GUI.LoadTheme(“theme_5”, “themes/theme_5/”)
_G.GUI.SetTheme(“theme_5”)
– CREATE THE WIDGET
_G.GUI.NewInput(
{
x = “center”,
y = screenH*.2,
width = “70%”,
theme = “theme_5”,
name = “MyWidget1”,
caption = “Enter Your Name…”,
notEmpty = true,
textColor = {20,40,20},
inputType = “default”, – “number” | “password” | “default”
allowedChars = “ABCabc1234567890.!?”,
quitCaption = “Tap screen to finish text input.”,
onChange = function(EventData) print(EventData.value) end,
onBlur = function(EventData) newtext=EventData.value print(“newtestinside”,newtext) end,
} )
print (“newtextoutside”,newtext) [import]uid: 107974 topic_id: 31475 reply_id: 331475[/import]