11 Replies Latest reply on Jul 16, 2007 9:31 AM by luciewong

    change size of index.html dynamically?

    luciewong Level 1
      Hi,
      my original index.html has a size of 752x1250.

      On Frame 1 it loads certain data (background color and user defined website size) in with asp.
      When this data is received, I change the website color with an “getUrl” command as the user has defined the color.
      This works fine.

      But can I also change the document size of index.html at the same time.
      If the user has defined the size 752x2500 height, then I want to change the height of index.html to this size as I do the background.

      Is this possible?
      Thank you for your help.

      Regards,
      Lucie
        • 1. Re: change size of index.html dynamically?
          .:}x-=V!P=-x{:. Level 3
          yes have Flash call a Javascript function to resize window.
          • 2. Re: change size of index.html dynamically?
            kglad Adobe Community Professional & MVP
            you can change the size of the browser window but you can't change the flash stage dimensions. you'll need a work-around (use a mask, for example) to make it appear the stage dimensions have changed.
            • 3. Re: change size of index.html dynamically?
              .:}x-=V!P=-x{:. Level 3
              actually you can change the flash stage dimensions but however i cannot reveal my method
              • 4. Re: change size of index.html dynamically?
                kglad Adobe Community Professional & MVP
                and i have a sure fire method to generate unlimited amounts of money legally in little time and with no effort, but this quick reply box is too small to contain the information.
                • 5. Re: change size of index.html dynamically?
                  luciewong Level 1
                  Thank you Kglad and “.:}x-=V!P=-x{:.” for your reply.

                  When data is loaded, I change the background color with the code below:

                  //xxxxchange BG color>>
                  nwebBGColor = TwebBG;
                  code1 = "JavaScript:changeBgColor(";
                  code2 = nwebBGColor;
                  code3 = ")";
                  UrlCode = (code1 + code2 + code3);
                  getURL(UrlCode);
                  //xxxxx
                  //xxxxxxhtml>
                  <script language="JavaScript">
                  <!--
                  function changeBgColor(newBgColor) {
                  if (window.document && window.document.bgColor) {
                  document.bgColor = newBgColor;
                  }
                  }
                  // -->
                  </script>
                  //xxxxxxxxxxxxxxx


                  Could I build in this code also the function to change the height?
                  And how should this look like?
                  “.:}x-=V!P=-x{:.” if you could give me a hint, really appreciate it.
                  Thanks

                  Hi Kglad,
                  the Browser opens first with a height of 1300 and when my data is in, Flash knows, the height should be actually 2500. It should then change the browser’s height regarding its content to 2500.
                  When I make a mask or an emptyMovieClip, still I think I must send some JavaScript to change the browser?

                  About money sounds interesting, can you give me some info?
                  newbrainstorm@hotmail.com
                  Thank you.
                  Best regards,
                  Lucie

                  By the way, I’ve found out, that all my websites have this “click to activate” - Frame around again. Does the previous Update-code from MM not work anymore with the latest Microsoft Browser version?
                  Bye

                  • 6. change size of index.html dynamically?
                    .:}x-=V!P=-x{:. Level 3
                    kglad - touché lol
                    • 7. Re: change size of index.html dynamically?
                      sergiourra Level 1
                      Why not using stage resize?
                      • 8. Re: change size of index.html dynamically?
                        luciewong Level 1
                        Sorry guys,
                        but still no clou how I should do this.
                        stage.resize does not work<thank you anyway.

                        regards
                        Luciewong
                        • 9. Re: change size of index.html dynamically?
                          motionman95 Level 1
                          HaHa! I found it:

                          Stage size control with ActionScript
                          This sample demonstrates how the Stage.scaleMode property affects the values of Stage.width and Stage.height when the browser window is resized.

                          You can find the sample source file, stagesize.fla, in the Samples folder on your hard disk.

                          In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScript\StageSize.
                          On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/StageSize.
                          • 10. Re: change size of index.html dynamically?
                            Gorka Ludlow Level 1
                            How about this:
                            instead of changing the stage's dimensions you use a huge stage with the noscale option selected and then whenever you change the browser's size all you need to do is relocate the movieclips in your movie to the correct position.

                            Cheers,
                            Gorka
                            www.AquiGorka.com
                            • 11. Re: change size of index.html dynamically?
                              luciewong Level 1
                              Hi guys,
                              thanks for your replies to my post.
                              In the meantime I have solved the problem.

                              this.cHeight_btn.onPress = function(){
                              var nHeight:Number = 3500;
                              _level0.getURL("javascript:resizeSWF("+nHeight+");");
                              };

                              And in my Html index I call the function:>

                              <!--
                              function resizeSWF(nHeight) {
                              nHeight += "px";
                              //document.getElementById("resizer").style.height = nHeight;
                              document.getElementById("index_Admin").style.height = nHeight;
                              if (window.document && window.document.height) {
                              window.document.height = nHeight;
                              }
                              }
                              //-->

                              Now I change my Browser height with a button click from my Flash SWF file, that's what I wanted.
                              Thanks for your interest.

                              Luciewong