• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

72

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
Community Expert ,
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

Votes

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