I think I am regressing

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]

ui.lua and the corresponding images are all in the same place as your main.lua right?

c [import]uid: 24 topic_id: 18771 reply_id: 72250[/import]

Yes ! [import]uid: 95689 topic_id: 18771 reply_id: 72263[/import]

Never mind, got around it thanks to RAH tutorial ! [import]uid: 95689 topic_id: 18771 reply_id: 72285[/import]

what was it?

c [import]uid: 24 topic_id: 18771 reply_id: 72287[/import]

I don’t know, I got around it by using the button method on this tutorial:" Corona SDK 10: Screen Transitioning ", by Dr. Rafael Hernandez at http://www.youtube.com/user/cheetomoskeeto
[import]uid: 95689 topic_id: 18771 reply_id: 72318[/import]