I’m trying to use the newfound popUp functionality in director in my game and I’m getting an error:
Director ERROR: Failed to execute news( params ) function on ‘nil’.
My call to load the popup:
[lua] director:openPopUp({score=gameScore, msg=message}, “correct”, correctPopClosed )[/lua]
correct.lua
[lua]module(…, package.seeall)
function new(params)
local close = function ( event )
if event.phase == “ended” then
director:closePopUp()
end
end
local localGroup = display.newGroup()
local correctBackground = display.newImageRect(“correct.png”, 512, 384)
correctBackground.x = display.contentWidth / 2
correctBackground.y = display.contentHeight / 2
correctBackground.isVisible = false
localGroup:insert(correctBackground)
continueButton = display.newImageRect(“continue.png”, 150, 32)
continueButton.x = display.contentWidth / 2
continueButton.y = display.contentHeight - 32
localGroup:insert(continueButton)
continueButton:addEventListener(“touch”, close)
correctTimer = timer.performWithDelay(5000, close)
function clean()
if correctTimer ~= nil then
timer.cancel(correctTimer)
end
end
return localGroup
end[/lua]
Any ideas?
[import]uid: 19626 topic_id: 15735 reply_id: 315735[/import]