how do i group insert a function

my code how would i put this in to scene:create
 

[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]

what do you mean put it in scene:create? 

IF you simply want your clock to display, put this code inside scene:create(event) 

that’s all you need. 

Try the following:

scene:create(event)

local sceneGroup = self.view

 – Your code here–

sceneGroup = display.newGroup()

sceneGroup: insert(clockText)

end

Also, make sure to dispose off any display objects you create in the scene:destroy(event) function. Remember gotoScene returns a listener to function scene:hide(event), you need to type composer.removeScene(< put your current scene name here> ) to get a listener call to scene:destroy

what do you mean put it in scene:create? 

IF you simply want your clock to display, put this code inside scene:create(event) 

that’s all you need. 

Try the following:

scene:create(event)

local sceneGroup = self.view

 – Your code here–

sceneGroup = display.newGroup()

sceneGroup: insert(clockText)

end

Also, make sure to dispose off any display objects you create in the scene:destroy(event) function. Remember gotoScene returns a listener to function scene:hide(event), you need to type composer.removeScene(< put your current scene name here> ) to get a listener call to scene:destroy