Can't modify objects in scene:show() ?

Hi,

So I have created the scene elements and added them to the appropriate group. Specifically there is a text object in this scene. Now, I would like to modify the text before the scene is shown… I thought the scene:show() function is supposed to do that.

However, when I’m trying to do this

TextObject.text = “the text”

inside the scene:show() function it gives me an error saying that TextObject is nil. Inside the Create function it works normally. What is the point of the scene:show function if it doesn’t have access to the objects in the scene?

This sounds like a scope issue.  If you declared TextObject “local” inside of scene:create() then only scene:create() can see it.  You can put:

local TextObject

at the top of the scene and then leave the “local” off if it in scene:create() and that should solve your problem.

Rob

This sounds like a scope issue.  If you declared TextObject “local” inside of scene:create() then only scene:create() can see it.  You can put:

local TextObject

at the top of the scene and then leave the “local” off if it in scene:create() and that should solve your problem.

Rob