Welcome, Guest
  • Author Topic: Trouble closing pop-up  (Read 1633 times)

    Mike Yoder

    • Server what's that
    • *
    • Posts: 5
      • View Profile
      • IHTFP
      • Email
    Trouble closing pop-up
    « on: 08/17/02, 15:39 »
    I've got a little problem with the "close pop-up" code I got out of the pop-up generator.  I've got some javascript code on a HTML page for this purpose which was in place before I ran across this site.  On my main page, the buttons work perfectly to open and place the pop-up exactly where I wanted them.

    I wanted to take this thing one step further and have the buttons close an open pop-up before making another pop-up selection.  To do this, I modified my swf so that the button would redirect to a frame in the same scene where the "Get URL" resides.  After opening the first pop up, I had it set so that the button was loaded with the close window command, followed by a redirect to another frame in the movie with a "Get URL" ActionScript for a different pop-up.

    Problem is, when I tested this out it didn't close the existing pop-up - it just left it opened, minimized it and set it down on the task bar, still running.  The new pop-up shows up right on cue, so that's no problem.

    The JS I'm using in the page is as follows:

    <script language="JavaScript">
       function openNewWindow(URLtoOpen, windowName, windowFeatures) {
           NewWindow=window.open(URLtoOpen, windowName, windowFeatures);
    }  
     
    </script>

    Do I need to modify that, or add a separate script for closing?  I'm pretty new to both Flash and JS, so please bear with me.

    Thanks, Mike




    Flash-db

    • Administrator
    • Systems Administrator
    • *****
    • Posts: 1876
      • View Profile
      • Flash-db.com
    Re:Trouble closing pop-up
    « Reply #1 on: 08/18/02, 17:24 »
    What does you script on the button look like that calls that JS function?

    Alot of it usually has to do with what you are naming the " windowName" - as this is what differentiates Popup windows - If you know the name of the specific one you want to close, it should work.  But if you don't know the name - it will not work.  If you try to open a window that has the same name - it will open in the same window.

    Well the point is - it probably has to do with how your keeping track and naming your popup windows.  
    Flash-DB

    Faheem Ullah Hashmi

    • Seasoned Programmer
    • ***
    • Posts: 250
      • MSN Messenger - faheem_u_h@hotmail.com
      • View Profile
      • Blue Vision
      • Email
    Re:Trouble closing pop-up
    « Reply #2 on: 08/19/02, 01:09 »
    i think u have two options for that...

    u can load the new pop with the same name as ur previous pop.. so that it will open in the same pop win... so there will be no need of closeing the previous one..

    or u have to give the target to the close win function.. so that it will close ur specified win....

    .                 \\|//
     .                (o o)
    ~~~~oOOo~(_)~oOOo~~~~
                                            c/ya
                                            Faheem
    http://www.debug-zone.com
    http://www.debug-zone.com/info/faheem.html
    faheem@debug-zone.com