So i tried this, and I get an error anytime I fill in the URL. If I leave the URL empty, it does run with a text button “Register”, bur tapping it gives me the following error:
Error loading module ‘scenes.menu’ from file ‘/Users/salfenito/Desktop/Lua Lesson/StarExplorer/scenes/menu.lua’:
/Users/salfenito/Desktop/Lua Lesson/StarExplorer/scenes/menu.lua:17: ‘<name>’ expected near ‘/’
File: error loading module ‘scenes.menu’ from file ‘scenes/menu.lua’
Line 17 would be the webView:request
local composer = require( "composer" ) local scene = composer.newScene() -- ----------------------------------------------------------------------------------- -- Code outside of the scene event functions below will only be executed ONCE unless -- the scene is removed entirely (not recycled) via "composer.removeScene()" -- ----------------------------------------------------------------------------------- local function gotoGame(URL) composer.gotoScene( "game" ) end local function showURL() local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 800, 1400 ) webView:request( http://spawndesignsolutions.com ) end -- ----------------------------------------------------------------------------------- -- Scene event functions -- ----------------------------------------------------------------------------------- -- create() function scene:create( event ) local sceneGroup = self.view -- Code here runs when the scene is first created but has not yet appeared on screen local background = display.newImageRect( sceneGroup, "background.png", 800, 1400 ) background.x = display.contentCenterX background.y = display.contentCenterY local title = display.newImageRect( sceneGroup, "title.png", 500, 80 ) title.x = display.contentCenterX title.y = 200 local playButton = display.newText( sceneGroup, "Play", display.contentCenterX, 700, native.systemFont, 44 ) playButton:setFillColor( 0.82, 0.86, 1 ) local regButton = display.newText( sceneGroup, "Register", display.contentCenterX, 810, native.systemFont, 44 ) regButton:setFillColor( 0.75, 0.78, 1 ) playButton:addEventListener( "tap", gotoGame ) regButton:addEventListener( "tap", showURL ) end