Copy link to clipboard
Copied
Hoping someone can help with this ongoing issue I have in AS3. I am using this code
popupBtn.addEventListener(MouseEvent.CLICK, popup);
function popup(e:MouseEvent):void{
ExternalInterface.call("window.open", "http://youtu.be/iGAHnZ555nI", "win", "width=1000,height=559");
}
to open a popup/popover window on this test site http://villagegreenstudios.com/view10 . It works like a charm in Chrome (both Mac and PC) and IE on PC. It works on Safari, Firefox (Mac) but takes a loooooooong time on Safari and even loooooonger time on FF for the new window to load. While loading in FF I get the spinning wheel of death and have to force quit after waiting over minute. I'm currently unable to check it on my PC's FF for unrelated reasons.
Help?
Copy link to clipboard
Copied
your swf embedding code is incorrect.
you should either let flash publish your embedding html or use swfobject, but not both.
in no case should you use dreamweaver to embed your swf.
Copy link to clipboard
Copied
Thanks kglad but I threw this site up as a down-and-dirty example of my issue without regard to embedding. I could be mistaken but I don't think embedding-method is causing this problem. If you navigate directly to the swf http://villagegreenstudios.com/view10/popuptest.swf the problem still exists.
Correct me if I'm wrong.
Copy link to clipboard
Copied
i don't see a problem navigating directly to the swf (using the link in message 2) and i see a problem when navigating to the html (using the link in message 1).
i tested using ff.
Copy link to clipboard
Copied
kglad: The problem still exists for me in Safari and FF on my Mac at the swf address. Are you on a Mac?
Copy link to clipboard
Copied
Yet in AS2
on (release) {
var jscommand:String = "window.open('http://youtu.be/iGAHnZ555nI','win','height=559,width=1000,toolbar=no,scrollbars=yes');";
getURL("javascript:" + jscommand + " void(0);");
}
It works everywhere, every time.
Here's the original using the html that Flash outputs with the swf. Has the same issue in Safari and FF on my Mac.
Copy link to clipboard
Copied
i tested using a windows pc. i didn't test using my mac.
Copy link to clipboard
Copied
SOLVED
For anyone else that might be dealing with this odd issue, I have found a way to make it work.
First, add this code the the <head> section of your HTML doc:
<SCRIPT LANGUAGE=JavaScript>
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}
</SCRIPT>
Then in AS3 use the following code for your buttons. I have the code below for the two buttons found here- http://villagegreenstudios.com/view10 Button 1 (top) is "test" and button 2 (bottom) is "popupBtn";
test.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
var url:URLRequest = new URLRequest("javascript:openNewWindow('http://www.macromedia.com','thewin','height=400,width=400,toolbar=no,s crollbars=yes')");
navigateToURL(url,"_self");
}
popupBtn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler2);
function fl_MouseClickHandler2(event:MouseEvent):void
{
var url:URLRequest = new URLRequest("javascript:openNewWindow('http://youtu.be/iGAHnZ555nI','win','height=559,width=1000,toolbar=no,scrollbars=yes')");
navigateToURL(url,"_self");
}
I'm certainly open to any comments, especially ways of improving it but for all else, this works!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now