i'am trying to open popup window with adding my pageURL.
But not working in my code. what am i wrong? (not open any window)
var pageURL:String = ExternalInterface.call("getPageurl");
more_bmarks..addEventListener(MouseEvent.CLICK, bmClick);
function bmClick(event:MouseEvent):void
{
var address:String = "window.open('http://api.addthis.com/oexchange/0.8/offer?url=','newWin','width=400,height=300,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=Yes,fullscreen=No')";
var desiredURL:URLRequest = new URLRequest("javascript:"+ address + pageURL + "void(0);");
navigateToURL(desiredURL, "_self");
}
window.open is a JavaScript method. You cannot use navigateToURL to access JavaScript. You must use ExternalInterface. For example:
ExternalInterface.call("window.open('http://api.addthis.com/oexchange/0.8/offer?url=','newWin','width=400,h eight=300,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No, resizable=Yes,fullscreen=No')");
Thank you for replay,
In this example same url opened in popUp window. But i need to open popUp window with http://api.addthis.com/oexchange/0.8/offer?url= + my webpage url.
i'am using this is for social network sharing button. So what i do?
Try:
ExternalInterface.call("window.open('http://api.addthis.com/oexchange/0.8/offer?url='" + pageURL + "','newWin','width=400,height=300,left=0,top=0,toolbar=No,location=No ,scrollbars=No,status=No,resizable=Yes,fullscreen=No')");
Did you trace the desiredURL yet to see if it is not a valid url address? If it is, you should be able to paste it into your browser address bar and it will work.
As I already indicated, the code you originally posted does work when I use a known url, but it needs to have a valid url address, and you need to be testing using a browser (on a server would be best).
North America
Europe, Middle East and Africa
Asia Pacific