1

I am trying to open a URL in a new window (not in new tab).

I wrote the following code, but it would not open the URL in a new window; instead, it would open the URL in a new tab.

I have tried it in both Firefox and Chrome, but it has the same behavior in both browsers.

My Flex code is:

var path:String = "http://stackoverflow.com";
var urlRequest:URLRequest = new URLRequest(path);
navigateToURL(urlRequest,"_blank");
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ketan
  • 19,129
  • 42
  • 60
  • 98

1 Answers1

1

Are you testing on local environment or server?

If this is not the case, there also a similar question with accepted answer. Need help AS3 navigateToURL opening new window

Also the browser's settings should determine if that's actually a new window or a new tab. The user's preferences will determine the result

Hope will be possible to help, somehow. Good luck!

  • window:String (default = null) — The browser window or HTML frame in which to display the document indicated by the request parameter. You can enter the name of a specific window or use one of the following values:

  • "_self" specifies the current frame in the current window.

  • "_blank" specifies a new window.

  • "_parent" specifies the parent of the current frame.

  • "_top" specifies the top-level frame in the current window.

If you do not specify a value for this parameter, a new empty window is created. In the stand-alone player, you can either specify a new ("_blank") window or a named window. The other values don't apply.


Note: When code in a SWF file that is running in the local-with-filesystem sandbox calls the navigateToURL() function and specifies a custom window name for the window parameter, the window name is transfered into a random name. The name is in the form "_flashXXXXXXXX", where each X represents a random hexadecimal digit. Within the same session (until you close the containing browser window), if you call the function again and specify the same name for the window parameter, the same random string is used.**

Community
  • 1
  • 1
gabriel
  • 2,351
  • 4
  • 20
  • 23
  • I am testing on local environment. – ketan Feb 19 '15 at 07:02
  • As you suggested link in that link they suggest to use URLLoader to call php page and pass parameter. But my issue is diffrent i want to open new window with specified link. – ketan Feb 19 '15 at 07:07
  • 1
    I got your point now. I have tested and it's always opening a new window. Maybe the browser's settings should determine if that's actually a new window or a new tab. The user's preferences will determine the result. – gabriel Feb 19 '15 at 07:33
  • Ohh yes you right. I change browser settings and now it opens in new window. Thanks for help. – ketan Feb 19 '15 at 08:14