Skip to main content
Participant
September 23, 2021
Question

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

  • September 23, 2021
  • 1 reply
  • 121 views

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

    This topic has been closed for replies.

    1 reply

    JoãoCésar17023019
    Community Expert
    Community Expert
    September 23, 2021

    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