ERROR:table expected

Hello, I’ve started learning how to use corona via this tutorial and I’ve followed it step by step and I’m getting this error:
 
start.lua:24: ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’
stack traceback:

[C]:in function ‘insert’

start.lua:24: in function <start.lua:15>

?:in function ‘dispatchEvent’

?:in function ‘gotoScene’

 

start.lua

local storyboard = require("storyboard") local scene = storyboard.newScene() local startbutton function scene:createScene(event) local group = self.view local background = display.newRect(0, 0, display.contentWidth, display.contentHeight) background:setFillColor(0, .39, .75) group:insert(background) local bigplane = display.newImage("bigplane.png", 0, 0) group:insert(bigplane) startbutton = display.newImage("startbutton.png", 264, 670) group:insert(startbutton) end function scene:enterScene(event) startbutton:addEventListener("tap", startGame) end function scene:exitScene(event) startbutton:removeEventListener("tap", startGame) end function startGame() storyboard.gotoScene("gamelevel") end scene:addEventListener("createScene", scene) scene:addEventListener("enterScene", scene) scene:addEventListener("enterScene", scene) return scene&nbsp;

main.lua:24: in main chunk

Hi @annetawamono,

There are no line numbers shown in this post. Can you post exactly what line 24 is? Or actually, the entire function which line 24 is part of?

Thanks,

Brent

This is the code at line 24:

local bigplane = display.newImage(“bigplane.png”, 0, 0)

group:insert(bigplane)

Thank you

Looks like your image isn’t being loaded correctly and therefore can’t be inserted into the group. Could be because your image is not called “bigplane.png”, or is not in the same folder as the lua file, or is not a proper png.

It wasn’t in the same folder as the lua file. I’ve done that now and it works fine. Thanks for the help  :slight_smile:

Hi @annetawamono,

There are no line numbers shown in this post. Can you post exactly what line 24 is? Or actually, the entire function which line 24 is part of?

Thanks,

Brent

This is the code at line 24:

local bigplane = display.newImage(“bigplane.png”, 0, 0)

group:insert(bigplane)

Thank you

Looks like your image isn’t being loaded correctly and therefore can’t be inserted into the group. Could be because your image is not called “bigplane.png”, or is not in the same folder as the lua file, or is not a proper png.

It wasn’t in the same folder as the lua file. I’ve done that now and it works fine. Thanks for the help  :slight_smile: