How would I get a table listener (like in http://developer.coronalabs.com/content/events-and-listeners) working with Storyboard. That is in storyboard you create your objects in scene:createScene? The error I get is:
“attempt to index local ‘hairpinImg’ (a nil value)”
And this occurs at the line of the listener. Any ideas how to get working? (but still follow storyboard approach)
[code]
– key bits of code
local hairpinImg
– listeners
function hairpinImg:touch(event) – ERROR THROWN HERE see below
if event.phase == “began” then
scene:itemPickup(event.target)
end
end
– storyboard callback/functions
function scene:createScene( event )
hairpinImg = display.newImage( “image.png” )
end
function scene:enterScene( event )
hairpinImg:addEventListener(“touch”, hairpinImg)
end
– ERROR RECEIVED: attempt to index local ‘hairpinImg’ (a nil value)
[/code] [import]uid: 140210 topic_id: 29175 reply_id: 329175[/import]