Syntax Error near '='

I am trying to display an image title titlepage_Bianca(1).png on the screen, using the code: 

  1. local Petnapped = require( “Petnapped” )

  2. Petnapped.start()

3. 

  1. local titlepage_Bianca(1) = display.newImage( “titlepage_Bianca(1).png” )

  2. titlepage_Bianca(1).x = 160; titlepage_Bianca(1).y = 195

All of the desired files are there, however when I try to run the project in Corona it comes up with the error: 

e:\Petnapped\main.lua:4: syntax error near ‘=’

I tried the exact same thing with the physics example in the sample projects and it works with the same format. I have no clue how to fix this; any ideas?

What is titlepage_Bianca?  You use () for function calls.  You use [] to reference a table.  I don’t see where you are creating titlepage_Biana.  I suspect you want to use this as an array, so maybe you intended:

local titlepage_Bianca = {}

titlepage_Biana[1] = display.newImage(“titlepage_Bianca(1).png” )

titlepage_Biana[1].x = 160; titlepage_Biana[1].y = 195

Rob

Okay that worked; thank you! :slight_smile:

Alicia Clark

What is titlepage_Bianca?  You use () for function calls.  You use [] to reference a table.  I don’t see where you are creating titlepage_Biana.  I suspect you want to use this as an array, so maybe you intended:

local titlepage_Bianca = {}

titlepage_Biana[1] = display.newImage(“titlepage_Bianca(1).png” )

titlepage_Biana[1].x = 160; titlepage_Biana[1].y = 195

Rob

Okay that worked; thank you! :slight_smile:

Alicia Clark