Copy link to clipboard
Copied
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...')";
var desiredURL:URLRequest = new URLRequest("javascript:"+ address + pageURL + "void(0);");
navigateToURL(desiredURL, "_self");
}
Copy link to clipboard
Copied
Trace the value of desiredURL to see if it is a valid URL?
Copy link to clipboard
Copied
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,height=300,left=0,top=0,toolbar...')");
Copy link to clipboard
Copied
I checked the code presented using a known url in place of the variables and the popup window appeared, so it appears you can execute the javascript command thru a navigateToURL command. Testing must be done in a browser.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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')");
Copy link to clipboard
Copied
No, i tested, this is not working.
pageURL string is in as3 code, ExternalInterface.call function working in browser.
so this is not working i think.
Copy link to clipboard
Copied
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).