I have a back button in my game. It has a click event called btnTap. On click it gives an alert where the user is given two options, to go to "luduMenu" scene or to keep playing. But its not working, the scene still remains the same when I click yes. Heres the code I tried.
local onComplete = function ( event )
if "clicked" == event.action then
local i = event.index
if 1 == i then
-- Do nothing; dialog will simply dismiss
system.setIdleTimer( true )
storyboard.gotoScene ( "luduMenu" )
elseif 2 == i then
-- Open URL if "Learn More" (the 2nd button) was clicked
end
end
end
-- local forward references should go here --
local function btnTap(event)
local alert1 = native.showAlert( "Go Back", "Are you sure?", { "Yes", "No" }, onComplete )
return true
end