Hi - can anyone help with this issue.
I have scene created (file ‘ending.lua’) which uses a local scene reference
local scene = composer.newScene()
and then I use the standard scene:create, scene:show events to create display objects. I keep a local reference to all objects created, and use
local sceneGroup = self.view
to get the top level group into which these objects are added. Within this I add a back button widget and position this at display.contentCenterX
I am using Runtime:addEventListener( “resize”, onResize ) to call my resize function to re-layout my scene.
When I try to reposition to the new display.contentCenterX I get the error message 'Attempt to index upvalue ‘backButton’ (a nil value)
So I’m not sure what’s happening - is the local file reference to backButton invalid even though it’s stored after scene:create?
Also, what is the safe way to get a reference to the sceneGroup these objects are contained within? Is backButton.parent enough?
Because the event is coming from Runtime, I’m wondering if there’s some thread sync issues I’m hitting.
Any help would be appreciated.