Lua prbs

Hello everyone , Greetings from Egypt :slight_smile:

so I wrote this Piece of code for Multi scene app using Storyboard API

::::

local storyboard = require “storyboard”

storyboard.purgeOnSceneChange=true;

– display settings

display.setStatusBar(display.HiddenStatusBar);

– global vars

cX=display.contentCenterX

cY=display.contentCenterY

sLeft=display.screenOriginX

sWidth=display.contentWidth-sLeft*2;

sright=sLeft+sWidth;

sTop=display.screenOriginY 

sHeight=display.contentHeight-sTop*2;

sBottom=sTop+sHeight;

display.contentWidth=sWidth;

display.contentHeight=sHeight;

–some Constants

defaultTransition=“flip”;

color={200,200,200};

– functions used in whole app

function displaybg(grp)

    – body

    local bg

    bg=display.newRect(sLeft,sTop,sWidth,sHeight)

    bg:setFillColor(color);

    grp:insert(bg);

    return bg

end

– load scenetemplate.lua

storyboard.gotoScene( “menu” )

------------------------------------ and every time 

I launch it , it give me this Error O.o 

http://prntscr.com/2cew3w

please anyone knows a solution to this unknown Prb , write it to me :slight_smile:

thnx in advance :slight_smile:

Well line 15 of main.lua sLeft is nil.  This would imply that this line:

sLeft=display.screenOriginX

isn’t working, or something else is trashing sLeft.

Rob

so what shall I do ?  :frowning:

thnx , it is fixed now by itself :smiley:

Well line 15 of main.lua sLeft is nil.  This would imply that this line:

sLeft=display.screenOriginX

isn’t working, or something else is trashing sLeft.

Rob

so what shall I do ?  :frowning:

thnx , it is fixed now by itself :smiley: