Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PopUp code issue

Explorer ,
Jan 14, 2014 Jan 14, 2014

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?

TOPICS
ActionScript
763
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 14, 2014 Jan 14, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 14, 2014 Jan 14, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 14, 2014 Jan 14, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 14, 2014 Jan 14, 2014

kglad:  The problem still exists for me in Safari and FF on my Mac at the swf address.  Are you on a Mac?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 14, 2014 Jan 14, 2014

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.

http://villagegreenstudios.com/view10/popuptest.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 14, 2014 Jan 14, 2014

i tested using a windows pc.  i didn't test using my mac.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 17, 2014 Jan 17, 2014
LATEST

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines