Hello
I have a google map inside a webview.
When the user clicks on a marker on the map, I intercept the url and make a webview:stop() to stop the browser action.
Then I have to go to another screen.
If I do make webview:stop(), I get an error within the xcode simulator :
Lua Runtime Error: lua\_pcall failed with status: 2, error message is: ?:0: attempt to index global 'webView' (a nil value)
I I don’t make a webview:stop(), I do not get the error but the native object stays in place.
here’s the code :
function scene:willEnterScene( event )
local group = self.view
local hauteurMax = display.viewableContentHeight - 130
local largeurMax = 312
local top = 20
local function webListener(event)
if event.type == "other" then
local url = event.url
local r
r, url = utils.checkForUrlEmptyness(url)
if r then
local monNomVille
local monIdVille
local monPaysVille
monNomVille, monIdVille, monPaysVille = dataBase.recupVilleNom(url)
local options = {
effect = "slideLeft",
time = 500,
params = {
nomVille = monNomVille,
idVille = tostring(monIdVille),
paysVille = monPaysVille
}
}
webView:stop()
storyboard.gotoScene( "cities2", options )
end
end
local webView = native.newWebView(2, top, largeurMax, hauteurMax)
webView:request("gmap\_world.html", system.CachesDirectory )
webView:addEventListener("urlRequest", webListener)
group:insert(webView)
end
function scene:exitScene( event )
local group = self.view
group:removeSelf()
end
I do not find a work around. Maybe I am doing something wrong ? [import]uid: 5578 topic_id: 26713 reply_id: 326713[/import]