Can I require external lua files within a 'scene' function? bad argument #-2 when scene revisited.

I have a Corona project that has about a half dozen serparate lua files to help keep things organized. I'm now trying to integrate the director class for transitions between a menu screen and the game itself, but get errors when trying to return to a 'scene' that's already been viewed IF that scene calls any external lua files to add objects.

While the real files are significantly more convoluted, as a test I've set up a bare-bones scenario of main.lua, scene1.lua, scene2.lua and otherstuff.lua.

otherstuff.lua contains 3 simple lines to make a text object called othertext:

1
2
3
othertext = display.newText( "Here's some other text from a different lua file", 0, 0, native.systemFontBold, 16 )
othertext.x = 400
othertext.y = 700
views:1973 update:2012/2/10 9:26:24
corona forums © 2003-2011