A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: how do they do this???

  1. #1
    Member
    Join Date
    Mar 2002
    Posts
    68

    how do they do this???

    how do they do the resizing of the html window on



    http://www.davidwaxman.net/

    if anyone could point me in the right direction that would be great. thanks.

  2. #2
    Senior Member
    Join Date
    Sep 2002
    Location
    Texas
    Posts
    348
    Code:
    <SCRIPT LANGUAGE="JavaScript" SRC="./global.js"></SCRIPT>
    <SCRIPT LANGUAGE="JavaScript">
    var myMovie;
    function init()
    { if(String(navigator.platform).match("Win"))
      { myMovie = document.getElementById("glennSucks");
        myMovie.StopPlay();
        growMe(700,300);
        window.setTimeout('myMovie.Play();',2000);
      } else
      { growMe(700,300);
      }
    }
    function done_intro()
    { if(String(navigator.platform).match("Win"))
      { myMovie.StopPlay();
        growMe(800,600);
        window.setTimeout('myMovie.Play();',2000);
      } else
      { growMe(800,600);
      }
    }
    </SCRIPT>
    that is how he does it. hope that helps
    Great minds think for themselves.

  3. #3
    Member
    Join Date
    Mar 2002
    Posts
    68
    hey thanks a lot. but i am just wondering how ya initiate this script from within flash using java. thaks for the time. Patrick

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Top Shelf
    Posts
    757
    AS in flash:
    PHP Code:
    getURL("JavaScript:functionname();"); 
    This information is subject to change without notice and
    is provided "as is" with no warranty.

  5. #5
    Member
    Join Date
    Mar 2002
    Posts
    68
    sorry but i can't get it to work. if it would be not too much trouble could you tell me it. I have a window that i would like to be resized called Access.html and my homepage will tell it to open and then flash on Access.html will tell it to resize. Hope you get it. Thanks for the time

  6. #6
    say no more loydall's Avatar
    Join Date
    Feb 2001
    Location
    London
    Posts
    1,261
    Haven't looked at it myself but that bit of code that was posted is only a bit of whats going on. see the bit that says "SRC="./global.js" - Well that global.js is a file that contains all the code to do any moving or resizingof a window. They call a function called growme which they will have defined in global.js

    You cant just call a function that doesn't exist, which is what you're doing. You'd need to see the global.js to figure out how they did it.

  7. #7
    Senior Member
    Join Date
    Sep 2002
    Location
    Texas
    Posts
    348
    lol sorry about that. here is the global.js

    Code:
    var rate,xnow,ynow,xres,yres,ScreenW,ScreenH,C_Left,C_Top,popWindow;
    xres	  = 348;
    yres	  = 149;
    ScreenW   = window.screen.availWidth;
    ScreenH   = window.screen.availHeight;
    if(String(navigator.platform).match("Win"))
    { rate	  = 5;
    } else
    { rate    = 20;
    }
    
    function growMe(Nxres,Nyres)
    { if(Nxres != xres || Nyres != yres)
      { xnow = xres;
        xres = Nxres;
        ynow = yres;
        yres = Nyres;
      }
      done = 0;
      if(xnow<xres)
      { xnow += (rate*1.5);
      } else
      { done++;
      }
        if(ynow<yres)
        { ynow += rate;
        } else
        { done++;
        }
      resizeTo(xnow,ynow);
      moveTo((ScreenW-xnow)/2,(ScreenH-ynow)/2);
      if(done!=2)
      { setTimeout(String("growMe(" + xres + "," + yres + ")"),10);
      } else
      { if(xres == 800) 
        { resizeTo(xres,yres+10); 
          moveTo(((ScreenW-xres)/2),((ScreenH-yres)/2));
          var theMovie = document.getElementById("glennSucks");
          theMovie.width = 800; 
          theMovie.height = 600;  
        } else
        { resizeTo(xres,yres+24);
          moveTo(((ScreenW-xres)/2),((ScreenH-yres)/2));
        }
      }
    }
    Great minds think for themselves.

  8. #8
    Member
    Join Date
    Mar 2002
    Posts
    68
    thanks. i have to get some time then ill play with it. hopeully it works. thanks for the time. Patrick

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