A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Closing or Minimizing Parent Windows

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    32
    Here's what I want to achieve: A "select bandwidth" page that lets the user select the Flash/Non-Flash version of a site. They select "Flash", and it opens a new browser window with no nav bars or scroll bars, etc etc, and continues on with the rest of the site.
    That part is easy. The problem: How do I get rid of the parent window that has all the nav bars on it?
    I know I can't close it without the warning screen coming up. But is there a way to minimize it?

    What I'm finding is that if someone can still see a "back" button on the screen, their natural impulse is to click on it, even if it doesn't necessarily control the window they're working on. If they want to go back and it's the only "Back" button they can see, they're clicking like there's no tomorrow. But clicking "Back" on the "bandwdith select" page takes them back to wherever they were before they got to my site.

    Help? Anyone? Bueller?

    Thanks
    Neil

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    2,235
    Explorer won't let you close a window without the warning.

    What you can do is make it fit behind with the

    window.moveTo(a,b) and window.resizeTo(x,y) functions so that it is hidden behind the front window. I know this is a bit corny but it works fine.

    ~mgb

  3. #3
    Member
    Join Date
    Jul 2002
    Posts
    32
    Okay, that sound you hear is my credibility swooshing out the window with the following question:

    How exactly would I need to enter that code to make it work? Is it Actionscript, or Java?

    (I'm primarily using Flash and Dreamweaver MX...)

    Thanks a ton,
    Neil

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Posts
    2,235
    Put this in the head section of the html page that pops up-

    <script language="javascript">

    function hidePage()
    {
    opener.moveTo(100,100);
    opener.resizeTo(100,100);
    }

    </script>
    </head>

    <body onload="hidePage()">

    ~mgb
    [Edited by mgb on 08-03-2002 at 07:19 PM]

  5. #5
    Member
    Join Date
    Jul 2002
    Posts
    32
    But what if the page that opens isn't an HTML page?

    I was hoping that the "Bandwidth Selection" page would be the only one with nav bars and such on it - everything after that (at least on the high-end site) is contained in a series of Flash movies.
    The only way I knew of to open a new browser window with no nav bars and scroll handles, etc was to use the "OpenBrowserWindow" command out of Dreamweaver - am I missing something?

    Thanks for your time,
    Neil

  6. #6
    Member
    Join Date
    Jul 2002
    Posts
    32
    Never mind, just figured it out.

    I opened the popup window using OpenBrowserWindow, but instead of calling for a .swf file, it calls for an .htm window that's exactly the same size as the .swf it contains.
    That gave me a place to stick the script, and it works like a charm.

    Thanks a TON for all your help - that's been a frustration of mine for DAYS now.

    --N

  7. #7
    Junior Member
    Join Date
    Aug 2002
    Posts
    3
    Hi,

    I think it actually is possible to close the top-level parent window...

    I just got the 'Google' toolbar and once it loaded in a new new browser window, the main window shut down. Not sure if it was to do with a self-created registry permission change coz it happened in a flash.

  8. #8
    Senior Member
    Join Date
    Aug 2000
    Posts
    2,235
    Yes, I think there's a workaround, but Microsofts idea is that the user should have control of the main window - which strikes me a very fair.

    I don't know what the workaround is though.

    ~mgb

  9. #9
    Member
    Join Date
    Jul 2002
    Posts
    32
    I know. I guess it IS fair to give the user control of the main window, but that leaves my only choices as either cluttering up their desktop with more popup windows, or resizing and moving the "opener" window, which then resets my choice of size to be the new default size every time they open their browser, until they resize it again.

    If someone wanted to be mean to a new user, they could resize the window to 1x1, and someone like my mother wouldn't have a clue what to do with it. I feel guilty having it at 300x300. But it's the only way I know of to get the "attractive presentation" I'm after.

    --N

  10. #10
    Senior Member
    Join Date
    Aug 2000
    Posts
    2,235
    You can resize the opener by putting in the body tag-

    <body onfocus="resizeWin()">

    where resizeWin() is a function which does the reverse of the one that hides it.

    ~mgb

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