won't let me acces composer

ERROR

File: error loading module ‘level3’ from file ‘level3.lua’

Error loading module ‘level3’ from file ‘/Users/Bhupinder/Desktop/Archive/Old Desktop items not in use/carisma/move/testin/done/level3.lua’:

/Users/Bhupinder/Desktop/Archive/Old Desktop items not in use/carisma/move/testin/done/level3.lua:26: ‘=’ expected near ‘function’

 

stack traceback:

[C]: in function ‘error’

?: in function ‘gotoScene’

level2.lua:98: in function <level2.lua:85>

?: in function <?:221>

Here is your error:  level3.lua:26: ‘=’ expected near ‘function’

In file level3.lua

On line 26

It thinks an equal sign is missing near the word “function”.

With out seeing that line and code and the code around it, it’s going to be hard to answer you.

Rob

the code for reference [lua]

function scene:create( event )

local sceneGroup = self.view

local options =

{

text = “going”,

x = 160,

y = 100,

width = 128,

fontSize = 50,

}

local mytxt = display.newText(options)

sceneGroup:insert(mytxt)

– Initialize the scene here.
– Example: add display objects to “sceneGroup”, add touch listeners, etc.
end[/lua]

What is line 26?

What code comes before it?

[lua]function scene:create( event )[/lua]

that is the 26th line

Can you post your whole level3.lua file? You can probably remove the code in the scenes as that most likely not the problem here.

Thanks!

Tip:  Sometimes you will encounter a case where you try to load a composer scene and it fails with a hard to read message.

composer.gotoScene( "results" ) -- Fails for some reason with a weird error.

This is typically because of one or more syntax errors in the scene file.  The problem is, composer is one level removed and doesn’t always have a full contextual view.  It sees the error, but doesn’t have all the debug data it needs to report back what it found.  

Debug Trick

A trick to debug this is to load the file via require (temporarily).  This will always uncover file-level-visible syntax errors.

--composer.gotoScene( "results" ) -- Fails for some reason with a weird error. require( "results" ) -- Doesn't load screen, but may help you find the syntax error(s) in the scene file.

Once you find and resolve the syntax errors, go back to using the gotoScene() function.

Here is your error:  level3.lua:26: ‘=’ expected near ‘function’

In file level3.lua

On line 26

It thinks an equal sign is missing near the word “function”.

With out seeing that line and code and the code around it, it’s going to be hard to answer you.

Rob

the code for reference [lua]

function scene:create( event )

local sceneGroup = self.view

local options =

{

text = “going”,

x = 160,

y = 100,

width = 128,

fontSize = 50,

}

local mytxt = display.newText(options)

sceneGroup:insert(mytxt)

– Initialize the scene here.
– Example: add display objects to “sceneGroup”, add touch listeners, etc.
end[/lua]

What is line 26?

What code comes before it?

[lua]function scene:create( event )[/lua]

that is the 26th line

Can you post your whole level3.lua file? You can probably remove the code in the scenes as that most likely not the problem here.

Thanks!

Tip:  Sometimes you will encounter a case where you try to load a composer scene and it fails with a hard to read message.

composer.gotoScene( "results" ) -- Fails for some reason with a weird error.

This is typically because of one or more syntax errors in the scene file.  The problem is, composer is one level removed and doesn’t always have a full contextual view.  It sees the error, but doesn’t have all the debug data it needs to report back what it found.  

Debug Trick

A trick to debug this is to load the file via require (temporarily).  This will always uncover file-level-visible syntax errors.

--composer.gotoScene( "results" ) -- Fails for some reason with a weird error. require( "results" ) -- Doesn't load screen, but may help you find the syntax error(s) in the scene file.

Once you find and resolve the syntax errors, go back to using the gotoScene() function.