Table between scenes

Hi, guys!

I have a problem…

I have a table or a array of answers 

local numberlist = {‘58’, ‘68’, ‘78’, ‘88’, ‘98’}

I want to pass this to another scene but i can’t seem to be able to do it.

My thought was   composer.gotoScene( “testing”, “fade”, 100, params = { answers } ) but that’s not right.

Any help would be appreciated!

Thanks! I have been stuck with this problems for a while now.

composer.gotoScene(“testing”, { effect = “fade”, time=100, params = numberlist } )

In your testing.lua’s scene:create() and scene:show() functions:

local numberlist = event.params.numberlist

Rob

Thanks a lot Rob! Once i took a break i figured it out.

One scene:

local options = { effect = “fade”, time = 100, params = answers }

composer.gotoScene( “testing”, options )

Second scene: 

local answer = event.params

print ( table.concat(answer, ", ") ) – print it out just in case.

That seemed to work for me least.

composer.gotoScene(“testing”, { effect = “fade”, time=100, params = numberlist } )

In your testing.lua’s scene:create() and scene:show() functions:

local numberlist = event.params.numberlist

Rob

Thanks a lot Rob! Once i took a break i figured it out.

One scene:

local options = { effect = “fade”, time = 100, params = answers }

composer.gotoScene( “testing”, options )

Second scene: 

local answer = event.params

print ( table.concat(answer, ", ") ) – print it out just in case.

That seemed to work for me least.