I’ve just recently started messing with director class. I keep getting this error, I’ve tried changing my menu file name. Does anyone see an error in this code that I’m not?
module(…, package.seeall);
function new()
local localGroup = display.newGroup();
local startGroup = display.newGroup()
local bg = display.newImageRect(“images/background1.png”, _W, _H);
bg:setReferencePoint(display.CenterReferencePoint);
bg.x = _W/2; bg.y = _H/2;
local title = display.newImageRect(“images/money.jpg”, _W, 132);
title:setReferencePoint(display.CenterReferencePoint);
title.x = _W/2; title.y = title.height;
local play_btn = display.newImageRect(“images/play_btn.png”, _W, 75);
play_btn:setReferencePoint(display.CenterReferencePoint);
play_btn.x = _W/2; play_btn.y = _H/2 + play_btn.height;
play_btn.scene = “game”;
local credits_btn = display.newImageRect(“images/category.jpg”, _W, 75);
credits_btn:setReferencePoint(display.CenterReferencePoint);
credits_btn.x = _W/2; credits_btn.y = _H/2 + play_btn.height; + credits_btn.height;
credits_btn.scene = “credits”;
function changeScene(e)
if(e.phase == “ended”) then
director:changeScene(e.target.scene);
end
end
localGroup:insert(bg);
localGroup:insert(credits_btn);
localGroup:insert(title);
localGroup:insert(play_button);
play_btn_addEventListerner(“touch”, changeScene);
credits_btn:addEventListener(“touch”, changeScene);
return localGroup;
end