I am creating an app and i am having a problem . I created a link to take me to the login page but when I click the link it doesn’t work .
-- requires local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local widget = require("widget") -- background function scene:createScene(event) local screenGroup = self.view display.setDefault("background", 0, 3, 5) local icon = display.newImage("xx.png", 160, 100) screenGroup:insert(icon) local username = native.newTextField( 160, 230, 180, 30 ) username.placeholder = "Username" screenGroup:insert(username) local password = native.newTextField( 160, 270,180, 30 ) password.isSecure = true password.placeholder = "Password" screenGroup:insert(password) local email = native.newTextField( 160, 310, 180, 30 ) email.placeholder = "E-mail" screenGroup:insert(email) end -- Create the widget local Register = widget.newButton( { shape = "roundedRect", left = 70, top = 360, id = "Register", label = "Register", onEvent = handleButtonEvent } ) local loginLink = widget.newButton( { left = 70, top = 450, id = "Login", label = "Login here", onEvent = loginLink } ) local function handleButtonEvent( event ) if ( "ended" == event.phase ) then else end end local function loginLink( event ) if ( "began" == event.phase ) then storyboard.gotoScene("login", "fade", 200) end end function scene:enterScene(event) end function scene:exitScene(event) end function scene:destroyScene(event) end scene:addEventListener("createScene", scene) scene:addEventListener("enterScene", scene) scene:addEventListener("exitScene", scene) scene:addEventListener("destroyScene", scene) return scene
The loginLink is suppose to take me to the login page but it doesn’t . I am not getting any errors it’s just not doing it’s job . Can someone help me ?
