Here goes:
I have a Credits screen. I have some peeps that I am tipping including Corona. Since I do not have control over these pages, I cannot put a button on them with the ol’ “corona:close” action. So I encapsulated them with a local html file as follows:
<iframe src="http://www.anscamobile.com" width="768px" height="960px" frameborder="0"></iframe>
<form name="clostit" action="corona:close" style="margin: 0; text-align: center;">
<br> <input type="submit" value="Close"><br>
</form>
[/html]
then using:
local options = {baseUrl=system.ResourceDirectory, urlRequest=webHandler}
native.showWebPopup("localfile.html", options)
and the handler:
local webHandler = function(event)
local url = event.url
local shouldLoad = true
print(url)
if(url)then
if 1 == string.find(url, "corona:close") then
shouldLoad = false
native.cancelWebPopup()
end
end
return shouldLoad
end
Now when the close button is tapped, the popup fades out and brings me back to the credits screen but I’m locked up. Nothing else responds to events. Also, the print(url) does not show up in the Console (while running from the device of course).
All I want to do is close the darn webpage and return to gaming, anyone?
[import]uid: 21331 topic_id: 21837 reply_id: 321837[/import]
