Attempt to index local 'tempCash' (a nil value) -- tempCash is a imageSheet

Im a newbie and been goggled searching  and I cannot figure out or find an answer on why I’m getting this message.

I’m trying to call an imageSheet and I getting this error message. 

File: main.lua

Line: 47

Attempt to index local ‘tempCash’ (a nil value)

stack traceback:

main.lua:47: in function ‘setUpGameScreen’

main.lua:74: in main chunk

 

local tempCash

for i=1, #cashXPositions do

tempCash = display.newSprite(imageSheet,sequenceData)

tempCash.x = cashXPositions[i] 

tempCash.y = cashYPositions[i]

tempCash:setSequence(“blank”)

tempCash:addEventListener(‘tap’, cashHit);

gameScreenGroup:insert(tempCash)

table.insert(allCash,tempCash)

Line 47

tempCash.x = cashXPositions[i] 

Line 74 is

setUpGameScreen()

generally if an image is a nil value it means that it cant find the image file itself, are you sure its not “Cash.png”?

Thank you for your help. 

I figured it out. it was a typo similar to what you suggested. 

I wrote “numframes” instead of “numFrames” when i was creating options for my image sheet. 

generally if an image is a nil value it means that it cant find the image file itself, are you sure its not “Cash.png”?

Thank you for your help. 

I figured it out. it was a typo similar to what you suggested. 

I wrote “numframes” instead of “numFrames” when i was creating options for my image sheet.