Windows [SOLVED] Button to acces an external website in User's external internet browser

  • Thread starter Andrew R. C. Beck
  • Start date
A

Andrew R. C. Beck

Guest
Howdydiddlington folks!
Much as the title says, I want to be able to click a buttom in an executable of my game to run on windows, which would then open a url in the user's default web browser (IE, Chrome etc). Would anybody here be able to provide aid as to how I could set this up if it is possible?
 

CloseRange

Member
@Andrew R. C. Beck
Code:
url_open("https://google.com");
EDIT: I suppse to the rest of the question about buttons.
simply create an object for the button, give a sprite that looks like the button, and add a mouse left pressed event, then in that put the url_open
 
A

Andrew R. C. Beck

Guest
@Andrew R. C. Beck
Code:
url_open("https://google.com");
Thank you for the prompt response! :D I have tried this but it does not seem to be working :S I have read up and not sure if I need it to be an HTML5 browser run game or not :/ If that is the case then that is a problem as I ideally want to keep this game as a standalone executable
 

CloseRange

Member
shouldn't need to be. Before I responded I tested it in a windows project I had open and it worked fine for me. Well I initally tried just "google.com" before getting an error that I needed https://

Do you get an error or does it just not open? Try adding show_message("Hello") right next to it and see if that runs
 
A

Andrew R. C. Beck

Guest
shouldn't need to be. Before I responded I tested it in a windows project I had open and it worked fine for me. Well I initally tried just "google.com" before getting an error that I needed https://

Do you get an error or does it just not open? Try adding show_message("Hello") right next to it and see if that runs
Nope, no error message of any kind :S It just doesn't open at all :S I am using GMS 1.4 for this :) Shall Enter the hello message to test :)
 
A

Andrew R. C. Beck

Guest
@CloseRange ok so I just tried with the hello message and it is registering the click, yet the browser page does not open :S here is the code:

Left Mouse Released event:

Code:
show_message("Hello")
url_open("https://twitter.com/C_W_Games")
 
Last edited by a moderator:
R

robproctor83

Guest
No, I have no clue, but that is a real bummer because a lot of people use Chrome as their default. Are you testing from studio or running an exe manually? If your testing from studio try building the executable and run it manually. It may be a permission thing, no idea really.
 
A

Andrew R. C. Beck

Guest
No, I have no clue, but that is a real bummer because a lot of people use Chrome as their default. Are you testing from studio or running an exe manually? If your testing from studio try building the executable and run it manually. It may be a permission thing, no idea really.
Aaaah wait it is not specifically Chrome that was the issue! I hadf an adblocker active in my Chrome extentions but after disabling it, it worked :D

Thank you @CloseRange, @BaBiA Game Studio and @RubberGardener ! :D
 
A

Andrew R. C. Beck

Guest
Yes was about to say I use chrome and it still worked. Might be worth showing a small message in game that says "might not work with ad blocker"
Aaah that could be a good idea like to post on the game's itch page ;)
 
Top