composer.getSceneName

local composer = require( “composer” )

local currScene = composer.getSceneName( “current” ) returns nil.

I’m working on back key and need to get the current scene…

Is there some other way to do it, or should this work?

Without seeing that code in context, it’s very likely it should be returning nil.  Typically main.lua is not a scene and just require’ing composer doesn’t give you a current scene.  That value will not be set until after you’ve called storyboard.gotoScene() at least once.

Rob

Without seeing that code in context, it’s very likely it should be returning nil.  Typically main.lua is not a scene and just require’ing composer doesn’t give you a current scene.  That value will not be set until after you’ve called storyboard.gotoScene() at least once.

Rob