Hi, I’m currently having some problems making a button disappear:
[lua]module(…, package.seeall)
new = function()
local ui = require(“ui”)
local testGroup = display.newGroup()
– the function to create the cancel web popup button
local createCloseButton = function()
local button = ui.newButton {
default = “closeButton.png”,
over = “closeButton_pressed.png”,
onRelease = function()
native.cancelWebPopup()
display.remove(button)
end
}
button.x = display.contentWidth - (display.contentHeight / 8)
button.y = display.contentHeight / 8
testGroup:insert(button)
end
– the button to launch the web popup
local openWebPopUp = ui.newButton {
default = “button.png”,
over = “button_pressed.png”,
onRelease = function()
native.showWebPopup(40, 40, 320, 240, “http://www.google.com”)
createCloseButton()
end
}
openWebPopUp.x = (display.contentWidth / 8) * 2
openWebPopUp.y = display.contentHeight / 8
testGroup:insert(openWebPopUp)
return testGroup
end[/lua]
The button is able to close the web popup but I also want it to close itself too. [import]uid: 71024 topic_id: 22711 reply_id: 322711[/import]