Having read your last snippet, I think what you’re describing in your first post is different to what your code is trying to do. As I understand your description; you want to show a Web Popup Control and have it show a web page from a remote server. Is that correct?
Onwards, dear friends- If I’m correct about the above, I think the problem is that you’re trying to attach the listener as a system event listener.
Check here: http://developer.anscamobile.com/content/native-ui-features#options.urlRequest
Basically, it’s not actually a listener with an event handler, it is really a callback function.
Change your code to this:
[blockcode]
– this is called as a callback, not an event listener
function locationHandler( event )
end
– define the url to call (add GPS data to the end of the URL as GET params, if you need to)
local url = “http://mobile.tutsplus.com/author/carloz-yanez/”
– define the callback function
local options = { urlRequest = locationHandler }
native.showWebPopup( 0, 0, 320, 436, url, options ) – show the web popup
– Activate location listener
– Runtime:addEventListener( “location”, locationHandler ) – this is simply not needed
[/blockcode]
If you need to pass location data to the web page, you’ll have to do it via url GET parameters attached to the above ‘url’ variable.
Hope this helps, but please let me know if I’m barking up the wrong lamp post,
Matt. [import]uid: 8271 topic_id: 3509 reply_id: 10579[/import]