Adding action script top open URL (in same window) produces a white screen

New Here ,
Sep 23, 2021 Sep 23, 2021

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)? 

Views

30

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 23, 2021 Sep 23, 2021

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines