Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Application:exit() Error? — Gideros Forum

Application:exit() Error?

turker2000turker2000 Member
edited January 2016 in Code snippets
Hello everybody. I give the piece of code below Application:exit() line

main.lua:477: index '__userdata' cannot be found
stack traceback:
main.lua:477: in function

giving the error message. What is the problem?

Note: Sory my bad English.
local function onKeyUp(event)
	if event.keyCode == KeyCode.BACK then
		if GeriTusu == true then
			--Stage dahil edilmiş herşeyi SİL
			for ii=1,stage:getNumChildren() do
				stage:removeChild(stage:getChildAt(1))
			end
			Application:exit()
		end
	end
end
 
stage:addEventListener(Event.KEY_UP, onKeyUp)

Comments

  • hgy29hgy29 Maintainer
    edited January 2016 Accepted Answer
    Hi @turker2000,

    you should use:
    	application:exit()
    (lower case 'a' in application).
    +1 -1 (+2 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    yes Application is a class, and application is globally available instance of this class

    Likes: turker2000

    +1 -1 (+1 / -0 )Share on Facebook
  • It worked. Thank you.
Sign In or Register to comment.