touch error

hey i want to make my button if pressed go to next scene but this error poped up any body know how to fix this 

local options = { effect = "fade", time = 800, } local button = display.newImage ("play\_button.png") button.x = 160 button.y = 330 button:scale( 5.0, 5.0) local function nextscene (event) local touchedObject = event.target if event.phase then = "began" then touchedObject.gotoScene( "results", options ) end end button:addEventListener("touch", nextscene)

Unexpected symbol near ‘=’

 

File: main.lua

Line: 30

Line 30

Once you fix that line you’re going to run into problems with the next one.

Please learn to walk before you run. I know it’s tempting to make a game straight away, but you really need to read the getting started tutorials, play around with and UNDERSTAND the example code that comes with Corona first.

You’re doing the equivalent of learning carpentry by throwing a heap of wood and glue at a wall and hoping it becomes a shelf.

And the way you are using display.newImage and scaling by 5x is a tell-tale sign you haven’t worked through the basics.

No-one uses newImage to actually display images any more. It’s kept around as a quick way of discovering the dimensions of an unknown image, such as one downloaded on the fly.

display.newImageRect is the correct tool for the job.

if event.phase == “began” then

I suggest that you get a good book on Lua and work with the language basics before jumping into Corona. I appears from your mistakes that (to use an analogy) you are trying to install a roof, without first building a footer and walls.

I use Corona to build business apps and it is extremely powerful. It also assumes that you know what you are doing “under the covers”, and therefore won’t always tell you when you make logic and non-lua coding errors.

Line 30

Once you fix that line you’re going to run into problems with the next one.

Please learn to walk before you run. I know it’s tempting to make a game straight away, but you really need to read the getting started tutorials, play around with and UNDERSTAND the example code that comes with Corona first.

You’re doing the equivalent of learning carpentry by throwing a heap of wood and glue at a wall and hoping it becomes a shelf.

And the way you are using display.newImage and scaling by 5x is a tell-tale sign you haven’t worked through the basics.

No-one uses newImage to actually display images any more. It’s kept around as a quick way of discovering the dimensions of an unknown image, such as one downloaded on the fly.

display.newImageRect is the correct tool for the job.

if event.phase == “began” then

I suggest that you get a good book on Lua and work with the language basics before jumping into Corona. I appears from your mistakes that (to use an analogy) you are trying to install a roof, without first building a footer and walls.

I use Corona to build business apps and it is extremely powerful. It also assumes that you know what you are doing “under the covers”, and therefore won’t always tell you when you make logic and non-lua coding errors.