A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: secondary browser window size

  1. #1
    Member
    Join Date
    Feb 2005
    Posts
    43

    secondary browser window size

    secondary browser window size
    hello. I am using buttons in a base (navigation) .swf to open up photos (also swf's) in secondary browser windows. how can i get the size of the secondary browser window to match the size of the swf inside of it...?
    also,
    is there anyway to get rid of the menu options in the secondary browser window..?

    ** i am making .htm files in dreamweaver from the .swf's.. should i put this code in flash or dreamweaver?? ***

    thank you! -ryan

    www.landslideinteractive.com (samples / photo)

  2. #2
    World Kit Vote Holder Abelius's Avatar
    Join Date
    Feb 2002
    Location
    US
    Posts
    963
    Yes...
    Code:
    on (release) {
        getURL("javascriptpenNewWindow('site.html','thewin333','height=600,width=800,toolbar=no,scrollbars=no')");
    }
    Cordially,
    Abelius
    www.worldkit.com

  3. #3
    Member
    Join Date
    Feb 2005
    Posts
    43
    im pretty new to action scripting...

    currently i have the following code:

    on(release) {
    getURL ("bubbly.htm", "_blank");
    }

    >>"bubbly" is the name of the file i am retreiving. Im not sure exactly what to do with this code: (provided in reply to post)

    on (release) {
    getURL("javascriptpenNewWindow('site. html','thewin333','height=600,width=800,toolbar=no
    ,scrollbars=no')");
    }

    I tried replacing various parts of the code with the file name "bubbly.htm" to no avail. I receive an output error warning upon exporting it, and the button doesnt pull up the file. What parts should i change?? just the "javascriptpenNewWindow"?? do i need to alter my bubbly.HTM code aswell?

    thanks again -ryan

  4. #4
    World Kit Vote Holder Abelius's Avatar
    Join Date
    Feb 2002
    Location
    US
    Posts
    963
    Well, no. Now you have to add the Javascript code in the HTML document...
    Cordially,
    Abelius
    www.worldkit.com

  5. #5
    Member
    Join Date
    Feb 2005
    Posts
    43
    ok.. sorry man, im a little confused.
    so i put said code into the htm doc and my fla??
    an on release command in the htm??
    do i need to change any of the code that youve provided? where do i put the title of the .swf im loading ("bubbly.htm) within that code?

  6. #6
    World Kit Vote Holder Abelius's Avatar
    Join Date
    Feb 2002
    Location
    US
    Posts
    963
    OK, let's say you want to open a window with a button click:

    THis is the way you do it. In the flash file, on the button write this:
    Code:
    on(release){
        getURL("JavaScript(openNewWindow(popup_or_whatever.htm','newwin','height=500,width=700,left=20,top=20,toolbar=no,scrollbars=no');"))
    }
    Then, in the HTML document that contains THIS swf file (not the pop-up window) you write down this code before the body tag:

    Code:
    {script language="JavaScript"}
    function openNewWindow(URLtoOpen, windowName, windowFeatures) {
            newWindow=window.open(URLtoOpen, windowName, windowFeatures);
        }
        // This is only needed for Netscape browsers.
        function flashGetHref() { return location.href; }
        function flashPutHref(href) { location.href = href; }
        function flashGetTitle() { return document.title; }
        function flashPutTitle(title) { document.title = title; }
    {/script}
    Make sure you change the { and the } for < and >, I had to change it so you can see it here...

    Of course, in the Flash file you can change the values for width, height and so on...

    Hope this helps!
    Last edited by Abelius; 02-14-2005 at 03:55 AM.
    Cordially,
    Abelius
    www.worldkit.com

  7. #7
    Member
    Join Date
    Feb 2005
    Posts
    43
    thanks for sticking in there with me.. ok..
    this is the action i put on the button:

    on(release){
    getURL("JavaScript(openNewWindow(bubbly.htm','neww in','height=500,width=700,left=20,top=20
    ,toolbar=no,scrollbars=no")));
    }


    this is the error i get upon exporting:

    Symbol=samThumbButtphoto, Layer=sampPb1, Frame=10: Line 2: ')' or ',' expected
    getURL ("badKids.htm"'newwin','height=500,width=700,left= 20,top=20

    Symbol=samThumbButtphoto, Layer=sampPb1, Frame=10: Line 3: String literal was not properly terminated
    ,toolbar=no,scrollbars=no');");

    Symbol=samThumbButtphoto, Layer=sampPb1, Frame=10: Line 4: ';' expected
    }

    Symbol=samThumbButtphoto, Layer=sampPb1, Frame=10: Line 2: String literal was not properly terminated
    getURL("JavaScript(openNewWindow(bubbly.htm','neww in','height=500,width=700,left=20,top=20

    Symbol=samThumbButtphoto, Layer=sampPb1, Frame=10: Line 3: String literal was not properly terminated
    ,toolbar=no,scrollbars=no"));

    Symbol=samThumbButtphoto, Layer=sampPb1, Frame=10: Line 4: ')' or ',' expected
    }

    any ideas??
    -r

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