Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unable to launch the popup from javascript called from flex swf

1 view
Skip to first unread message

John Naing

unread,
Mar 20, 2009, 2:31:18 AM3/20/09
to
hi guys,

I've been trying to open a popup from javascript using
externalinterface call. except for the IE other browsers are working
well. is there any workaround to support IE?
thanks in advance. . .
let me show you some code

it's from flex

private function openDynamicJavaScriptWindow( event:MouseEvent) : void
{
if(ExternalInterface.available)
{
ExternalInterface.addCallback
("openWindowFromSwf",openWindownFromSWF);
var a:* = ExternalInterface.call("openWindow","http:\
\www.google.com","_blank");
var b:String = ExternalInterface.call("setvalue","2345");
}
}

private function openWindownFromSWF(urlstring:String):void
{
navigateToURL(new URLRequest(urlstring),"_blank");
}


and here is the javascript

var swfId = "popupSwf";

function openWindow(pageUrl) {
var winName = Math.round(9999*Math.random()) + new Date
().getTime();
var winNew = window.open
(pageUrl,winName,"toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=800,height=700,left=200,top=100");

if(!winNew) {
getSwf(swfId).openWindowFromSwf(pageUrl);
}
else {
winNew.focus();
}
}

function getSwf(id) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[id];
}
else {
return document[id];
}
}

0 new messages