Opening a link via the browser

0 favourites
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • Hi there,

    I am trying to open a link in a new window with the browser. I can't get it to work when I test on remote device. Do I have to make an adhoc for this functionality to work?

  • If you are trying to open a link by clicking on a sprite, then this should work:

    Add a button, put it on top of your sprite so they click on a button to open a link.

    Make the button invisible by adding onStartofLayout > button set CSS style to "opacity" to "0"

  • This is all you need for it to work on a sprite. Remote Preview is fine...

    http://prntscr.com/j7wrgh

  • No it is not. It's unreliable. It may change with browser updates, but that would often be blocked by browsers for security reasons.

    Clicking on buttons counts as user input. Just clicking on a sprite does not.

  • I am using the on touched object and that object is a text.

    I do seem to remember this working in C2. Perhaps things have changed in C3.

  • I can confirm that the button works.

    However, I cannot change the color, or the opacity of the button. It makes styling a link really challenging.

    Ashley - How do you suppose we can fix this. Is there anyway to make a touched sprite or text a user input event?

  • The button has the "Set CSS style" action. You can apply all sorts of CSS to it, in your case you want to do "opacity" "0.00001" to make the button essentially invisible. and overlay it on the sprite.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • All user input triggers should count as user input events, whether they are on a sprite or on a button. If it does not work on a sprite, please file a bug.

  • This is all you need for it to work on a sprite. Remote Preview is fine...

    http://prntscr.com/j7wrgh

    i tried this on ios its work , bot android no work , do you know why ?

  • I submitted this as a bug. Thanks Ashley

  • It's not a bug though. For security reasons browser will not let you open links automatically and tapping a sprite counts about the same as just opening a link automatically, a pop up or whatever. Buttons count as user action so they should work in every situation.

    You may get different results on different browsers or different versions of same browser because people coding these things spend more time on reddit and youtube than thinking while coding.

  • You may get different results on different browsers or different versions of same browser because people coding these things spend more time on reddit and youtube than thinking while coding.

    what people are you talking about? mozzila ? chrome?

    its not about the people who code it.. its about the security enforced by different platform devices. its a device issue OS ... not a browser issue.

    each browser is adapting different to the device runs on

  • Talking about all of them. They are inconsistent and often clueless. Same device, same browser will do different things sometimes. But that's a different topic. Using invisible buttons in Construct is the most reliable thing right now.

  • I can confirm that on iOS the touch sprite does not work. The touch button does work though.

  • Update, it seems to have been fixed with Adhocs now. Problem solved.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)