how would this transition

when i am using this code i test it so it goes to blank scene i don’t want it be on the blank scene but i need it be on other scenes just not all of them how would i keep this in a certain scenes. I am using composer,scene

and this my code

[lua]local secondsLeft = 20 * 60
local clockText = display.newText(“20:00”, 160,30)
local function updateTime()
secondsLeft = secondsLeft - 10
local minutes = math.floor( secondsLeft / 60)
local seconds = secondsLeft % 60
local timeDisplay = string.format("%02d:%02d", minutes, seconds)
clockText.text = timeDisplay
if timeDisplay == “18:00” then
composer.gotoScene(“menu”)
end
end
local countDownTimer = timer.performWithDelay(1000, updateTime, secondsLeft)[/lua]

Im sorry but your going to have to explain this better for someone to help… Thanks!

You can put them in a separate module. I thought there was a good tutorial for this, but can’t seem to find it. In any case, just have a separate file and put the following:

local M = {} M.secondsLeft = 120 -- and so on in this manner return M

Save it as myData.lua.

Then in scenes where you want to access it, put

local myData = require "myData"

up the top.

You can get the values like you would from any table:

myData.secondsLeft

Im sorry but your going to have to explain this better for someone to help… Thanks!

You can put them in a separate module. I thought there was a good tutorial for this, but can’t seem to find it. In any case, just have a separate file and put the following:

local M = {} M.secondsLeft = 120 -- and so on in this manner return M

Save it as myData.lua.

Then in scenes where you want to access it, put

local myData = require "myData"

up the top.

You can get the values like you would from any table:

myData.secondsLeft