I have a screen with a web-pop up. When I hit my back button to go back to my menu screen, it causes my animations to freeze on that screen and then none of the buttons work. What do I need in the code on my web-pop up screen to keep it from doing that?
[lua]module(…, package.seeall)
function new()
local localGroup = display.newGroup()
–> This is how we start every single file or “screen” in our folder, except for main.lua
– and director.lua
–> director.lua is NEVER modified, while only one line in main.lua changes, described in that file
local ui = require(“ui”)
local aboutbackground = display.newImage (“aboutbackground.png”)
localGroup:insert(aboutbackground)
–> This sets the background
local backbutton = display.newImage (“backbutton.png”)
backbutton.x = 160
backbutton.y = 425
backbutton.xScale = .5
backbutton.yScale = .5
localGroup:insert(backbutton)
local function touchedBackbutton (event)
if (“ended” == event.phase) then
– close the web popup
native.cancelWebPopup()
director:changeScene(“menu”)
media.playEventSound( “click_x.caf” )
end
end
backbutton:addEventListener (“touch”, touchedBackbutton)
–***************************************************
– showHelpPopup()
–***************************************************
local showHelpPopup = function()
local topLoc = 73
if system.getInfo(“model”) == “iPad” then
topLoc = 73 + 34
end
native.showWebPopup( 25, 100, 280, 305, “help.html”, {baseUrl=system.ResourceDirectory, hasBackground=false } )
end
local cleanUp = function()
backbutton:removeEventListener(“touch”, touchedBackbutton)
–***************************************************
– init()
–***************************************************
local init = function()
showHelpPopup() --> display local help.html file
end
init()
end
–>MUST return a display.newGroup()
–> This is how we end every file except for director and main, as mentioned in my first comment
return localGroup
end[/lua] [import]uid: 72372 topic_id: 14256 reply_id: 314256[/import]
[import]uid: 52491 topic_id: 14256 reply_id: 52641[/import]