A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: HOW DO YOU RESIZE THE BROWSER WINDOW AS SEEN AT DEVLAB.SWIFT3D??

  1. #1
    Member
    Join Date
    Jul 2000
    Posts
    34
    *!FIRST OFF!* go to http://devlab.swift3d.com/ and click on ANY of the movies available and you will see the popup window actually resize and morph to accomodate the loading movie and I just wanted to know if any of the flash gurus might have a clue as to how this is done.

    PLEASE DO NOT REPLY IF YOU HAVE NOT VISITED THE SITE as you wont know what I mean.

    The effect is SERIOUSLY cool and NO flash site has a tutorial on this.

    its always the rare effects that are the best.....

    HELP PLEASE.

  2. #2
    Member
    Join Date
    Jul 2000
    Posts
    34
    allow me to apologize in advance for the double posting, but I feel that I REALLY need to claify what it is im after so that I dont get advice instead on simply opening a popup window with fixed dimensions accidentally.

    sorry.

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Posts
    2,235
    The windows don't actually move - a new window overlaps the one on screen, at least the ones I looked at did. Here's a bit of code to resizeBy and moveBy (see also resizeTo and moveTo)

    <script language="JAVASCRIPT" type="TEXT/JAVASCRIPT"><!--

    function reForm(){
    window.resizeBy(66,66);
    window.moveBy(-33,-33);
    }


    // -->
    </script>

    In general resizeBy(x,y); where x = width, y = height.

    this will extend the width/height by 66 and keep it centered by shifting it back and up by 1/2 that amount.

    cheers

    ~mgb
    [Edited by mgb on 06-02-2001 at 08:22 PM]

  4. #4
    Senior Bumbler
    Join Date
    Dec 2000
    Posts
    522
    Here it is...

    Its at MM Exchange in an extension format. But you are without dreamweaver, here it...

    In the <head>
    Code:
    <!--
    function TB_animateWindow(windowWidth,windowHeight,targetWidth,targetHeight,widthMod,heightMod,fullScreen)
     {
       // http://www.timbooker.com
       // http://www.saltstonemedia.co.uk
    
    	if (fullScreen)
    	 {
    		targetWidth = screen.availWidth;
    		targetHeight = screen.availHeight;
    	 }
    
    	if (windowWidth < targetWidth) windowWidth += widthMod;
    	if (windowHeight < targetHeight) windowHeight += heightMod;
    
    	windowLeft = (screen.availWidth / 2) - (windowWidth / 2);
    	windowTop = (screen.availHeight / 2) - (windowHeight / 2);
    
    	window.resizeTo(windowWidth,windowHeight);
    	window.moveTo(windowLeft,windowTop);
    
    	if (windowWidth < targetWidth || windowHeight < targetHeight)
    		setTimeout('TB_animateWindow(' + windowWidth + ', ' + windowHeight + ', ' + targetWidth + ', ' + targetHeight + ', ' + widthMod + ', ' + heightMod + ', ' + fullScreen + ');',10);
     }
    //-->
    In the BODY tag
    Code:
    onLoad="TB_animateWindow(100,100,600,600,5,5,false)"
    The 100,100 refer to the starting dimensions.

    The 600,600 refer to the final dimensions.

    The 5,5 refer to the pixels to increase per step (width,height).

    False refers to whether it should increase to full screen. (in which case the 600,600 should be shown as 0,0.)

    Courtesy of Tim Booker!


  5. #5
    Member
    Join Date
    Jul 2000
    Posts
    34
    The above script is excellent, but I was wondering if you or anyone else might know how to modify it so that it also shrinks browser windows........


  6. #6
    exchange.macromedia.com

    Dreamwaever 4 extention

  7. #7
    Member
    Join Date
    Jul 2000
    Posts
    34
    I downloaded the MM extension as recommended, but STILL am stuck as the script does not shrink the window.

    I know this is not a Javascript forum, but surely someone that comes here possesses the knowledge of how to edit the above script so that it also works in the reverse....

    Somebody?

    Help.

  8. #8
    Senior Bumbler
    Join Date
    Dec 2000
    Posts
    522
    function TB_animateWindow(windowWidth,windowHeight,targetWi dth,targetHeight,widthMod,heightMod,fullScreen)
    {
    // http://www.timbooker.com
    // http://www.saltstonemedia.co.uk

    if (fullScreen)
    {
    targetWidth = screen.availWidth;
    targetHeight = screen.availHeight;
    }

    if (windowWidth < targetWidth) windowWidth += widthMod;
    if (windowHeight < targetHeight) windowHeight += heightMod;

    //added this to handling reduction
    if (windowWidth > targetWidth) windowWidth -= widthMod;
    if (windowHeight > targetHeight) windowHeight -= heightMod;


    windowLeft = (screen.availWidth / 2) - (windowWidth / 2);
    windowTop = (screen.availHeight / 2) - (windowHeight / 2);

    window.resizeTo(windowWidth,windowHeight);
    window.moveTo(windowLeft,windowTop);

    //added this to check for not equal instead of less than

    if (windowWidth != targetWidth || windowHeight != targetHeight)
    setTimeout('TB_animateWindow(' + windowWidth + ', ' + windowHeight + ', ' + targetWidth + ', ' + targetHeight + ', ' + widthMod + ', ' + heightMod + ', ' + fullScreen + ');',10);
    }

    Call the function with
    TB_animateWindow(770,410,300,300,5,5,false)

  9. #9
    Member
    Join Date
    Jul 2000
    Posts
    34
    Well Holy *****, I just cant believe how good this forum is!

    Wdglide, you ARE the man.

    Thank you VERY much dude.

  10. #10
    Senior Bumbler
    Join Date
    Dec 2000
    Posts
    522
    Its Tim Booker that was the genius.

    As for the forum, yes it is awesome. 75% of what I learned I can trace back to Flashkit.

    Your welcome.
    Phil

  11. #11
    Member
    Join Date
    Jul 2000
    Posts
    34
    Yes, yes, credit where credits due, Tims the man and so are you.

    Erm...that wasn't actually supposed to rhyme....but who gives a *****?

    Thanx anyhow.


  12. #12
    Senior Bumbler
    Join Date
    Dec 2000
    Posts
    522
    thanks!

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