Hello guys. I’ve been thinking about this a lot lately.So i want to add a link to a site into the game. The problem is that if i use a code about this in update function like this
navigateToURL(new URLRequest("link"), "_blank");
The browser take it as a popup and block it(so i need to click allow on the browser to actually get into the link)
And if i use a event listener like this:
//in constructor
FP.stage.addEventListener ( MouseEvent.CLICK, TheLink ) ;
//the event listener
public function TheLink (e:Event):void
{
if (collide("cursor", x, y) )
navigateToURL(new URLRequest("link"), "_blank");
}
Sometimes i get a bug that everywhere i click it opens the link(not blocked this time tho cause it doesn’t wait until the end of the frame to open it). Any ideas of a working code for adding a link into the game?