Director Tables support

Hello forum guys

I am simply following is online tutorial “Corona SDK App Creation” and i have created three files:
Main.lua / Intro.lua / menu.lua

Now the tutorial asks for a director.lua file, i downloaded one from a tutorial on Corona by Ricardo.

But the simulator keeps giving me runtime errors with the director.lua file:

director.lua:1092 in changeScene’Runtime error:
director.lua 1092 in attempt to call method ‘insert’

ERROR: failed to excute new( params) function on intro
These are my three codes:

MAIN.LUA

function changeScene(e)
if (e.phase == “ended”) then
director:changeScene(e.target.scene)
end
end

local director =require(“director”)
local mainGroup = display.newGroup()

mainGroup:insert(director.directorView)
director:changeScene(“intro”)

INTRO.LUA

module (…, package.seeall)

function new()

local introGroup = display.newGroup()

local background = display.newImage (“graphics/index.png”)

local learn = display.newImage (“graphics/learn_button1.png”)
learn.x = 150
learn.y = 380
begin.scene = “menu”

introGroup:insert(background)
introGroup:insert(learn)

learn:addEventListerner(“touch”, changeScene)

return introGroup

end

MENU.LUA

module (…, package.seeall)

function new()

local menuGroup = display.newGroup()

local background = display.newImage(“graphics/learn_background.png”)

local join = display.newImage(“graphics/join_button.png”)
join.x = 150
join.y = 380
menuGroup:insert(background)
menuGroup:insert(join)

learn.addEventListerner(“touch”, changeScene)

return menuGroup

end

[import]uid: 181704 topic_id: 33329 reply_id: 333329[/import]

This is not the answer to your question,
just to make clearer for other people who can help read the codes.

main.lua
[lua]function changeScene(e)
if (e.phase == “ended”) then
director:changeScene(e.target.scene)
end
end

local director =require(“director”)
local mainGroup = display.newGroup()

mainGroup:insert(director.directorView)
director:changeScene(“intro”)[/lua]

intro.lua
[lua]module (…, package.seeall)

function new()
local introGroup = display.newGroup()
local background = display.newImage (“graphics/index.png”)

local learn = display.newImage (“graphics/learn_button1.png”)
learn.x = 150
learn.y = 380
begin.scene = “menu”

introGroup:insert(background)
introGroup:insert(learn)

learn:addEventListerner(“touch”, changeScene)

return introGroup

end[/lua]

menu.lua
[lua]module (…, package.seeall)

function new()
local menuGroup = display.newGroup()
local background = display.newImage(“graphics/learn_background.png”)
local join = display.newImage(“graphics/join_button.png”)
join.x = 150
join.y = 380

menuGroup:insert(background)
menuGroup:insert(join)

learn:addEventListerner(“touch”, changeScene) – you had typo there “.” I changed to “:”

return menuGroup

end[/lua] [import]uid: 31508 topic_id: 33329 reply_id: 132389[/import]

This is not the answer to your question,
just to make clearer for other people who can help read the codes.

main.lua
[lua]function changeScene(e)
if (e.phase == “ended”) then
director:changeScene(e.target.scene)
end
end

local director =require(“director”)
local mainGroup = display.newGroup()

mainGroup:insert(director.directorView)
director:changeScene(“intro”)[/lua]

intro.lua
[lua]module (…, package.seeall)

function new()
local introGroup = display.newGroup()
local background = display.newImage (“graphics/index.png”)

local learn = display.newImage (“graphics/learn_button1.png”)
learn.x = 150
learn.y = 380
begin.scene = “menu”

introGroup:insert(background)
introGroup:insert(learn)

learn:addEventListerner(“touch”, changeScene)

return introGroup

end[/lua]

menu.lua
[lua]module (…, package.seeall)

function new()
local menuGroup = display.newGroup()
local background = display.newImage(“graphics/learn_background.png”)
local join = display.newImage(“graphics/join_button.png”)
join.x = 150
join.y = 380

menuGroup:insert(background)
menuGroup:insert(join)

learn:addEventListerner(“touch”, changeScene) – you had typo there “.” I changed to “:”

return menuGroup

end[/lua] [import]uid: 31508 topic_id: 33329 reply_id: 132389[/import]