I don’t know if this is a problem with my code or a problem with CoronaSDK, but whenever I use this code, when it tries to call the function (from Options button) it works but instantly crashes half a second later:
local ui = require("ui")
function createmainmenu()
Options = ui.newButton{
default = "buttonBlue.png",
over = "buttonBlueOver.png",
onPress = clearmainmenu,
onRelease = clearmainmenu,
text = "Options",
emboss = true
}
end
function clearmainmenu()
if Options ~= nil then
Options:removeSelf()
end
end
--Start
createmainmenu()
Could someone shed some light on this error please? I only ask questions if I’ve exhausted all my options and its pretty hard to debug something that doesn’t give me a debug message… [import]uid: 44393 topic_id: 8155 reply_id: 308155[/import]