dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: how a button opens a new maximized browser window?

  1. #1
    Junior Member
    Join Date
    Aug 2000
    Posts
    3

    Unhappy

    Hi there,
    I'm new here, need some urgent help.

    I've designed a basic Flash intro for a site, after the movie(or if you skip intro)HTML will show up.
    I need to learn what should I do with the buttons to make them open a new browser window at maximized size ?

    Thanks.

  2. #2
    Junior Member
    Join Date
    Jul 2000
    Posts
    27
    Hey there!

    I reckon you're best bet would be to use an FS Command, so that you can call some script in the hosting web page to open the maximised window.

    For example:

    <The button action script in the Flash movie>
    FS Command ("openMaxWindow", "")

    <Web page script>
    <SCRIPT language=VBScript>
    <!--

    Sub openNewWindow()

    'To open maximised
    window.open "nextwindow.html","","width=" & screen.width & ",height=" & window.height

    '--OR-- To open fullscreen (IE only?)
    'window.open "nextwindow.html","","fullscreen=yes"

    End Sub

    -->
    </SCRIPT>

    When you publish the Flash movie, make sure you select the Flash with FS Command option in the HTML tab. The resulting HTML will have some script that Flash generates, but where it says "//Your code here" you must place the following java chunk:

    if (command=='openMaxWindow')
    {
    openNewWindow();
    }

    That'll act as the middle-man that receives the FS command from the Flash movie and relay the call onto the VB Script to open the new window.

    If you have any trouble with this (like understanding it!!) then don't hesitate to contact me. I'm new to this stuff too, but I've learnt it by other people's help on this site, so I am more than willing to help others.

    Jay

  3. #3
    Junior Member
    Join Date
    Aug 2000
    Posts
    3
    Thanks jaygemson,
    I tried to understand, everything is fine except one.

    I have 'movie1.swf','movie1.html'and 'index.html'

    at the VB Script code for the web page should I type index.html in place of nextpage.html, although I'm in index.html??

    ...
    window.open "index.html","","width=" & screen.width & ",height=" & window.height
    ...

    or
    did you mean placing the VBScript in 'movie1.html'

    I couldn't make it work by the first one and the browser window stopped responding.

    Thanks again
    Regards.



  4. #4
    Junior Member
    Join Date
    Jul 2000
    Posts
    27
    I'm assuming index.html to be the page you want to be maximised, and movie1.html (and movie1.swf) to be the intro page.

    In that case, you want the VBScript and FS Command hook to be placed in movie1.html and you want to use window.open "index.html","",..


  5. #5
    Junior Member
    Join Date
    Aug 2000
    Posts
    3
    Thanks,
    I'll try that.

    Hey here is so good!Thanks a lot.
    enjoy the time.

  6. #6
    Junior Member
    Join Date
    Jul 2000
    Posts
    27
    Hey, its nice to get something working, right? Its no problem helping out a fellow developer!

    Just tried the code myself actually, and it works. However, you want to add some properties to the window.open command:

    window.open "index.html","","left=0,top=0,width=" & screen.width...

    Then it'll be in the top corner but you may have to fiddle with the width and height (E.g. subtract 10 from them) to get the window to fit perfectly in the screen.

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