2 Replies Latest reply on Jul 24, 2007 4:07 AM by Saqibm

    Popup window from a swf

    Mondo_Bug
      At the moment, I can open a new window from the swf, but I need it to be a certain size. I've done some research on the web, gone a few different directions, but I can't seem to get this to work. What I've tried:


      on (release) {
      getURL("javascript:windowOpener('mobile.html, '_blank', 'height=345, width=600')");
      }

      When I upload to the server and check I get this error message:

      Error: windowOpener is not defined.

      Any idea why this is happening? Do I need to define the windowOpener in my index.html page? A tip I got from a different site said to add this JavaScript to the body of your page:

      <SCRIPT LANGUAGE="JavaScript">
      <!-- Begin
      function Launch(page) {
      OpenWin = this.open(page, "mobile", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes,width=550,height=250");
      }
      // End -->
      </SCRIPT>


      Any idea why it doesn't work?

      thanks

        • 1. Re: Popup window from a swf
          [AtomiK]
          Hi,

          Yeah, your actionscript call and javascript functions don't match.

          In the actionscript line, you're calling a javascript function called "windowOpener" and are passing along 3 parameters....
          In the javascript, you have a function named "Launch" that accepts 1 parameter...

          This mismatch is causing your problem.

          What you'd most likely want to do is change your javascript function to something like this:



          <SCRIPT LANGUAGE="">
          <!-- Begin
          function windowOpener (url, params)
          {
          OpenWin = window.open(url, "mobile", params);
          }
          // End -->
          </SCRIPT>



          In your actionscript, you can actually ditch the "_blank", as you're using window.open to open a new blank window anyways.
          So your actionscript call would look something like this:



          on (release) {
          getURL("javascript:windowOpener('mobile.html', 'height=345,width=600');");
          }

          Hope this helps!
          [AtomiK]
          • 2. Re: Popup window from a swf
            Saqibm
            Hi,

            I have a problem that i want to open a popup window from swf not from internet explorer. When i had made this and click on the button in ".swf" and the messag ll apear

            "Macromedia Flash Player has stopped a potentially unsafe operation.
            The following local application on your computer or network: "location + file name" is trying to communicate with this internet-enable location.....etc and also have OK and setting buttons"

            Please help me out of this situation, Thanx