9 Replies Latest reply on Jan 9, 2011 8:34 AM by kglad

    How do I center my site in browser

    10 Stories Brand

      I'm new at Flash so my code understanding is very limited.  For my 1st site I tried to make a very simple site which would float in the center of the browser, but my site is centered and stuck at the top below the browser.

       

      1. How do I get it centered both vertical & horizontal?

       

      2. How do I edit the placement position in design mode without having to go into code?

       

      My site address is www.tenstoriesbrand.com
      I'm sure I have more code then is needed because I started with a sample file and tried to delete unneeded parts.
        • 1. Re: How do I center my site in browser
          kglad Adobe Community Professional & MVP

          you'll need to edit your html code.

          1 person found this helpful
          • 2. Re: How do I center my site in browser
            10 Stories Brand Level 1

            I saw a simular question you answered saying type "/center" behind & in front of "/body" but "body appears several times in my code, how do I locate the correct one is this is the answer?

            • 3. Re: How do I center my site in browser
              kglad Adobe Community Professional & MVP

              that will only horizontally center your swf and as someone pointed out, is deprecated in favor of using css.

               

              but more importantly, you can only have one <body> and one </body> tag in your html file or you have bigger problems than centering.  have flash publish your html file so you start with correctly encoded html.

              1 person found this helpful
              • 4. Re: How do I center my site in browser
                10 Stories Brand Level 1

                OK, I published through flash & only have 1 body now, but the site is still centered under the browser bar.

                • 5. Re: How do I center my site in browser
                  kglad Adobe Community Professional & MVP

                  copy and paste your html here.

                  • 6. Re: How do I center my site in browser
                    10 Stories Brand Level 1

                    I found a very helpful link here:

                    http://www.youtube.com/watch?v=CcswpZRiYIg&feature=related

                     

                    This got me centered near the top working through design mode but I'd still like to center vertically so the site appears in the direct center no matter how large or small I open the window.

                     

                     

                     

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

                    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

                    <head>

                    <title>index</title>

                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                    <style type="text/css" media="screen">

                    html, body { height:100%; background-color: #ffffff;}

                    #wrapper {

                    width: 1000px;

                    margin-right: auto;

                    margin-left: auto;

                    height: 600px;

                    }

                    body { margin-right:auto

                    margin-left:auto }

                    #flashContent { width:100%; height:100%; }

                    </style>

                    </head>

                    <body>

                        <div id="wrapper">

                          <div id="flashContent">

                            <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1000" height="600" id="index" align="middle">

                              <param name="movie" value="index.swf" />

                              <param name="quality" value="high" />

                              <param name="bgcolor" value="#ffffff" />

                              <param name="play" value="true" />

                              <param name="loop" value="true" />

                              <param name="wmode" value="window" />

                              <param name="scale" value="noscale" />

                              <param name="menu" value="true" />

                              <param name="devicefont" value="false" />

                              <param name="salign" value="" />

                              <param name="allowScriptAccess" value="sameDomain" />

                              <!--[if !IE]>-->

                              <object type="application/x-shockwave-flash" data="index.swf" width="1000" height="600">

                                <param name="movie" value="index.swf" />

                                <param name="quality" value="high" />

                                <param name="bgcolor" value="#ffffff" />

                                <param name="play" value="true" />

                                <param name="loop" value="true" />

                                <param name="wmode" value="window" />

                                <param name="scale" value="noscale" />

                                <param name="menu" value="true" />

                                <param name="devicefont" value="false" />

                                <param name="salign" value="" />

                                <param name="allowScriptAccess" value="sameDomain" />

                                <!--<![endif]-->

                                <a href="http://www.adobe.com/go/getflash">

                                  <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />

                                </a>

                                <!--[if !IE]>-->

                                </object>

                              <!--<![endif]-->

                              </object>

                            </div>

                        </div>

                    </body>

                    </html>

                    • 7. Re: How do I center my site in browser
                      kglad Adobe Community Professional & MVP

                      use:

                       

                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                      <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
                      <head>
                      <title>index</title>
                      <style type="text/css" media="screen">
                      <!--
                      body
                          {
                          color: white;
                          background-color: #ffffff;
                          margin: 0px
                          }

                       

                      #horizon
                          {
                          position: absolute;
                          top: 50%;
                          left: 0px;
                          width: 100%;
                          height: 0px;
                          overflow: visible;
                          visibility: visible;
                          display: block
                          }

                       

                      #content   
                          {
                          background-color: #ffffff;
                          margin-left: -500px;
                          position: absolute;
                          top: -300px;
                          left: 50%;
                          width: 1000px;
                          height: 600px;
                          visibility: visible
                          }

                       

                      -->
                      </style>
                      </head>

                       

                      <body>
                              <div id="horizon">
                                  <div id="content">
                                 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1000" height="600" id="index" align="middle">
                                <param name="movie" value="index.swf" />
                                <param name="quality" value="high" />
                                <param name="bgcolor" value="#ffffff" />
                                <param name="play" value="true" />
                                <param name="loop" value="true" />
                                <param name="wmode" value="window" />
                                <param name="scale" value="noscale" />
                                <param name="menu" value="true" />
                                <param name="devicefont" value="false" />
                                <param name="salign" value="" />
                                <param name="allowScriptAccess" value="sameDomain" />
                                <!--[if !IE]>-->
                                <object type="application/x-shockwave-flash" data="index.swf" width="1000" height="600">
                                  <param name="movie" value="index.swf" />
                                  <param name="quality" value="high" />
                                  <param name="bgcolor" value="#ffffff" />
                                  <param name="play" value="true" />
                                  <param name="loop" value="true" />
                                  <param name="wmode" value="window" />
                                  <param name="scale" value="noscale" />
                                  <param name="menu" value="true" />
                                  <param name="devicefont" value="false" />
                                  <param name="salign" value="" />
                                  <param name="allowScriptAccess" value="sameDomain" />
                                  <!--<![endif]-->
                                  <a href="http://www.adobe.com/go/getflash">
                                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.g if" alt="Get Adobe Flash player" />
                                  </a>
                                  <!--[if !IE]>-->
                                  </object>
                                <!--<![endif]-->
                                </object>
                                  </div>
                              </div>
                      </body>
                      </html>

                      • 8. Re: How do I center my site in browser
                        10 Stories Brand Level 1

                        That works perfectly, thanks a lot!

                        • 9. Re: How do I center my site in browser
                          kglad Adobe Community Professional & MVP

                          you're welcome.