I’m new to coding for corona lua so please bare with me if this is a stupid question.
im trying to create some type of quit button to quit my android app, here is the sample code but it’s not working. Im sure its a stupid mistake but here it is
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
local ui = require “scripts.lib.ui”
local radlib = require “scripts.lib.radlib”
– BEGINNING OF YOUR IMPLEMENTATION
local myButton = display.newImage( “quit.png” )
function myButton:tap( event )
quit() os.exit() end timer.performWithDelay(1000,quit) <-----THE IMPLEMENTATION IS WHERE THE PROBLEM IS.
myButton:addEventListener( “tap”, myButton )
– END OF YOUR IMPLEMENTATION
–
– “createScene” event is dispatched if scene’s view does not exist
scene:addEventListener( “createScene”, scene )
– “enterScene” event is dispatched whenever scene transition has finished
scene:addEventListener( “enterScene”, scene )
– “exitScene” event is dispatched before next scene’s transition begins
scene:addEventListener( “exitScene”, scene )
– “destroyScene” event is dispatched before view is unloaded, which can be
– automatically unloaded in low memory situations, or explicitly via a call to
– storyboard.purgeScene() or storyboard.removeScene().
scene:addEventListener( “destroyScene”, scene )
return scene
thank you for all the help.