How do I open an external link in a new window on button press?

I’d like to have my little game reward the player with a link to a youtube video or similar. What js do I need to plug into the code editor while the button is selected?

The code for it is

window.open(//Put the link here)
Or
open(//Put Link here)

They both do the same thing which is just opening a new tab

3 Likes

In the bottom right corner of the editor is the asset library, and if you click the plus symbol at the top of it you should be able to find the “URL Link” asset which can be used to open a link when clicked. You just change the “url” variable to the one you want. Or instead of using the asset itself you could just use it’s code which looks like this.

// Change the URL to whatever you want!
var url = 'https://www.wickeditor.com';

window.open(url, '_blank');
3 Likes

If you want to learn a bit more this page talks about it.

3 Likes

Thank you that’s what I was looking for.