Hi,
I have used the following code before in another program, but when I copied it and pasted it on a present program it does not work. Could someone please let me know what I am doing wrong:
local ui = require( "ui" )
-- Handler for edit button
local edit\_btnRelease = function( event )
print("nothing yet");
end
-- display edit button
local edit\_btn = ui.newButton{
default = "buttonBlueSmall.png",
over = "buttonBlueSmallOver.png",
onRelease = edit\_btnRelease,
text = "edit",
size = 11,
emboss=true
}
edit\_btn.x = 200; edit\_btn.y = 250
It gives the following error:
Copyright (C) 2009-2011 A n s c a , I n c .
Version: 2.0.0
Build: 2011.591
The file sandbox for this project is located at the following folder:
(/Users/alexdiaz/Library/Application Support/Corona Simulator/Xela Development-4920B0BB4978D0D04A417C445B13E4F2)
Runtime error
/Applications/Xela Development/ui.lua:130: attempt to index local 'button' (a nil value)
stack traceback:
[C]: ?
/Applications/Xela Development/ui.lua:130: in function 'newButton'
/Applications/Xela Development/main.lua:8: in main chunk
Runtime error: /Applications/Xela Development/ui.lua:130: attempt to index local 'button' (a nil value)
stack traceback:
[C]: ?
/Applications/Xela Development/ui.lua:130: in function 'newButton'
/Applications/Xela Development/main.lua:8: in main chunk
Thanks
[import]uid: 95689 topic_id: 18771 reply_id: 318771[/import]