error says what it can’t index cutScene function in continueTap function
local function continueTap(event)
if event.phase == "began" then
if pressed == 1 then
pressed = 0
if storyNum < 5 then
storyNum = storyNum + 1
cutScene() -- Error happends here
background:removeEventListener("touch", continueTap)
end
end
end
end
local function cutScene()
if storyNum == 1 then
background = display.newImageRect(sceneGroup,"Images/SpaceBackground.png", actualContentWidth, actualContentHeight)
background.x = contentCenterX
background.y = contentCenterY
story = display.newImageRect(sceneGroup,"Images/story1Template.png", actualContentWidth, actualContentHeight)
story.x = contentCenterX
story.y = contentCenterY
storyText.text = "The rocket has just taken into space from a town called Rockville."
storyText:toFront()
continueText:toFront()
pressed = 1
continue()
background:addEventListener("touch", continueTap)
elseif storyNum == 2 then
storyText.text = "It's already the second their rocket this year!\n The rocket crew flies in search of other life forms."
pressed = 1
continue()
background:addEventListener("touch", continueTap)
end
end