Jump to content

New Buttons doesn't work on Mobile browsers


redrory
 Share

Recommended Posts

Hey,

 

So I'm customizing the Flying Dog game, on death;

 

When the score and restart screen appears, I have added additional buttons, this work perfectly on desktop browsers but not on mobile browsers (iPhone, Andriod and iPad).

 

I followed how the restartButton was added to add the others, however it's not recognized on mobile.

I added the others like this -

var moreBut = new game.Sprite('media/info.png', -100, 275);moreBut.interactive = true;box.addChild(moreBut);moreBut.click = function() {            window.location.href =  "http://awesomesuace.com";        }

On web, I'm taken to the link no problem, but on mobile it doesn't recognize the click

Edited by redrory
Link to comment
Share on other sites

Change this:

backBut.click = function() {            window.location.href =  "http://awesomesuace.com";        }

with:

backBut.touchstart = backBut.click = function() {            window.location.href =  "http://awesomesuace.com";        }
Link to comment
Share on other sites

Hey,

 

That was actually a typo that I made when adding code to this forum, as I also have a moreBut button. I've updated the code to reflect me calling the correct button.

 

Still not working on moble, the following works perfectly on Web even with the touchstart, just not on mobile

 moreBut.touchstart = moreBut.click = function() {            window.location.href =  "http://awesomesuace.com";        }
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...