Copy link to clipboard
Copied
Trying to make this button open a URL in the same window, but apply this script just produces a white screen (does not render anyting).
myButton.addEventListener(MouseEvent.CLICK,goThere);
function goThere(e:MouseEvent):void{
var request = new URLRequest("https://www.google.com","blank_");
navigateToURL(request);
}
Also, will this work for hash refferences (ID tags on header titles / wordpress)?
Copy link to clipboard
Copied
Hi.
The "blank_" argument belongs to the navigateToURL method and not to the URLRequest constructor call. So your function should be like this:
function goThere(e:MouseEvent):void
{
var request = new URLRequest("https://www.google.com");
navigateToURL(request, "blank_");
}
Also, when you say you want to open the page in the same window, do you mean browser window or Flash Player window? Because the Flash Player plugin for browsers reached its EOL in all major browsers.
But if what you want is to display web pages within a Flash application, consider using the StageWebView class.
I hope it helps.
Regards,
JC