A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Opening a popup window

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    127
    Hi,

    The following script opens a browser window, but the main browser also goes to a different location:
    Code:
    getURL("javascript:window.open('scores.php','Golf','width=320,height=240,scrollbars=yes')");
    How do I prevent that the main browser goes to another url? (the url changes in "javascript:window.open.. etc etc)

    Thanx in advance,

    Zander

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Location
    London
    Posts
    293

    opening multiples

    Hi,

    here's code to open as many window as you require, paste this into your html doc above the body tag:

    <SCRIPT LANGUAGE="JavaScript">
    <!--

    function newwinPAGENUMBER1()
    {
    window.open('yourpage.html','','scrollbars=yes,res izable=yes,width=375,height=375');
    }

    function newwinPAGENUMBER2etc()
    {
    window.open('yourpage.html','','scrollbars=yes,res izable=yes,width=375,height=375');
    }

    </script>

    in flash on your button:

    on (release) {
    getURL ("javascript:newwinPAGENUMBER1()");
    }

    So simply duplicate the javascript function change the PAGENUMBER1 to whatever number you need, do the same for the flash button.

    Does that make sense???

    regards
    BenG

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    108

    BenG... more flexability?

    function newwin(page)
    {
    window.open(page,'','scrollbars=yes,resizable=yes, width=375,height=375');
    }

    Then use getURLin Flash

    getURL("javascript:newWin('" + myPage + "')";

    You could even take that a step further and pass in a string like

    "myPage.html:375:200"

    Then the javascript could split the incomming string and pass up the page, width, and hieght to newwin.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Location
    London
    Posts
    293

    nice idea

    I'll give that a try for my latest project

    cheers
    BenG

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Posts
    127

    Smile Thanx

    Thanx for your help guys!

    Zander

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Location
    London
    Posts
    293

    page undefined

    RAMpage,

    sorry for dredging this back up, just needed to implement it.

    I tried your newwein(page) version, but it comes up with error 'page' undefined.... any ideas?
    BenG

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center