Dear Corona Developers,
I have been trying to add three buttons, purchase, restore and cancel, in my alert.
Unfortunately, I haven’t got any luck so far.
Corona Simulator Runtime error:
File: …esktop/Corona New Book Template JP IAP/pagescene.lua
Line: 40
Attempt to index global ‘restore’ (a nil value)
A friend of mine told me there is something wrong with my code.
Could anyone here show me how to correct it? (He told me my lua language is not correct… )
Thank you so much.
Henry
local function onComplete( event )
if “clicked” == event.action then
local i = event.index
if 1 == i then
– Do nothing; dialog will simply dismiss
elseif 2 == i then
restore:addEventlistener(“top”,payitem.restore)
end
elseif 3 == i then
purchase:addEventListener(“tap”, payitem.payIt)
end
end