14 Replies Latest reply on Aug 23, 2008 3:57 PM by el pescado

    White Box appears for a second before loading (Preloader?)

    el pescado Level 1
      Hello,

      This is my second post in 2 days (sorry). I am working with Flash MX. I am building a site and I have build a template of sorts (menu layout & background image). I was originally going to try to load external swf (which was yesterday's issue and now resolved) but it didn't quite give me the effect I was looking to achieve.

      So, I am now linking to each page using flash buttons. I drop a .swf it's own HTML page (home, contact, etc.). I am not sure if this is the best way to do it, but it has worked in the past. However, I am getting a white box where the swf sits as I navigate from page to page.

      Is this because I need a preloader? I have the background color in my .fla file set to black. If not, how do rid of the box?

      Thanks.
        • 1. Re: White Box appears for a second before loading (Preloader?)
          RossRitchey Level 4
          you need to set the background color in your HTML as well. The Flash Object displays the set background color that is set there (defaults to white if not set) until the SWF loads enough to display its background color.
          • 2. Re: White Box appears for a second before loading (Preloader?)
            Siggy30 Level 1
            I've created a new thread for this then saw this one. Are you saying the body or table background color needs to be set to the same color is the background used in the Flash movie to prevent the white box? If so, I get that same white box before a Flash movie loads and my background color is set to a unique color I created in Photoshop then made into a solid graphic and saved it. The color repeats throughout the site area I instructed it to be in the htrml code. Even so, this white box is still there filling the entire area until the movies contents loads.

            quote:

            Originally posted by: rritchey
            you need to set the background color in your HTML as well. The Flash Object displays the set background color that is set there (defaults to white if not set) until the SWF loads enough to display its background color.


            • 3. Re: White Box appears for a second before loading (Preloader?)
              el pescado Level 1
              Hey Thanks,

              I am using Dreamweaver and already set the background and then I just placed the swf in a layer in Dreamweaver. Is that what you mean? The white box still appears.

              I do notice that once I enter the site and navigate through...........the white box disappears (guess that is related to the cache).

              Thanks,
              • 4. White Box appears for a second before loading (Preloader?)
                RossRitchey Level 4
                The white is the background for the Object, not the table, nor the div, nor the body, the OBJECT.

                If you are using a swfobject to embed your flash, there is a setting in there that allows you to set bgcolor as well.

                ::EDIT::

                I have attached an example of an HTML document that uses swfobject 2 to embed a swf by the name of "untitled.swf" with a bgcolor of black until the swf loads. Note the 'param name="bgcolor" value="#000000"' tag located in 2 places.

                • 5. Re: White Box appears for a second before loading (Preloader?)
                  el pescado Level 1
                  Hey,

                  I think I added the correct code to the HTML but I am still getting the white boxes. Sorry, still stumped.

                  <body>
                  <div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; left: 52px; top: 0px;">
                  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="978" height="723">
                  <param name="movie" value="untitled.swf">
                  <param name="bgcolor" value="#000000" />
                  <param name="quality" value="high">
                  <embed src="lusties_home.swf" quality="high" pluginspage=" http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="978" height="723"></embed>
                  <param name="bgcolor" value="#000000" />
                  </object>
                  </div>
                  </body>
                  • 6. Re: White Box appears for a second before loading (Preloader?)
                    RossRitchey Level 4
                    Sorry, I should've posted the traditional object tag as well. Essentially, you need the bgcolor set in 2 places, as you have it, but slightly differently. The bgcolor parameter needs to be set as a param tag inside the object, and as a paramater of the embed tag. Here is your code fixed:

                    • 7. White Box appears for a second before loading (Preloader?)
                      Siggy30 Level 1
                      What if the body background being used isn't an image color code but an actual graphic that's been created and simply repeats throughout? Do you place background="images/filename.jpg" within the object code, rather then bgcolor="#000000"?
                      • 8. Re: White Box appears for a second before loading (Preloader?)
                        RossRitchey Level 4
                        unfortunately, it can only take a color code. You may be able to work something out setting the wmode to transparent. This causes the flash to display transparent in the window (no background color). See the edited object code attached.

                        • 9. Re: White Box appears for a second before loading (Preloader?)
                          el pescado Level 1
                          Hey, I couldn't wait to try this out. I pasted your code in and I am still having the issue. Maybe it's just the way I have set this up. I like having individual swf on each page. Not sure where to go from here. I really do appreciate all your help in sticking with my issue. Sorry if I am misunderstanding things. As I learn, I want my work to look professional.

                          Also, at what point do I use a preloader? Is it always needed?

                          Here is my HTML code:

                          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                          " http://www.w3.org/TR/html4/loose.dtd">
                          <html>
                          <head>
                          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                          <title>Untitled Document</title>
                          <script language="JavaScript" type="text/JavaScript">
                          <!--



                          function MM_reloadPage(init) { //reloads the window if Nav4 resized
                          if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
                          document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
                          else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
                          }
                          MM_reloadPage(true);

                          function MM_preloadImages() { //v3.0
                          var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
                          var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
                          if (a .indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
                          }
                          //-->
                          </script>
                          <style type="text/css">
                          <!--
                          body {
                          background-color: #000000;
                          }
                          body,td,th {
                          color: #000000;
                          }
                          -->
                          </style></head>

                          <body>
                          <div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:1; left: 52px; top: 0px;">
                          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="978" height="723">
                          <param name="movie" value="untitled.swf">
                          <param name="bgcolor" value="#000000" />
                          <param name="quality" value="high">
                          <embed src="untitled.swf" quality="high" pluginspage=" http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="978" height="723 bgcolor="#000000""></embed>
                          </object>
                          </div>
                          </body>
                          </html>
                          • 10. White Box appears for a second before loading (Preloader?)
                            RossRitchey Level 4
                            Odd that it isn't working. Your code is accurate.

                            Perhaps you could try making the wmode transparent (instructions in my previous reply)

                            Also, run your SWF through the bandwidth profiler to tell if you need a pre-loader.

                            To do this:

                            Control / Test Movie

                            When the SWF opens.

                            Turn on the Bandwidth Profiler ( View / Bandwidth Profiler )
                            Set the download settings to simulate with a 56K connection ( View / Download Settings -> 56K )
                            Tell it so simulate the download ( View / Simulate Download )

                            At this point you will see your progress run in a few different places. The important one is at the bottom of the upper left area. It will count out your percentage loaded, as well as the amount of inoformation loaded.

                            The typical rule of thumb here is that if it takes more than 30 seconds for your viewer to see something, you need a pre-loader. I tend to stray towards 10 seconds when I build projects. It is typically better to have a preloader and not need it, then to not have a preloader and need it.
                            • 11. Re: White Box appears for a second before loading   (Preloader?)
                              Level 7
                              el pescado wrote:
                              > Hey, I couldn't wait to try this out. I pasted your code in and I am still
                              > having the issue. Maybe it's just the way I have set this up. I like having
                              > individual swf on each page. Not sure where to go from here. I really do
                              > appreciate all your help in sticking with my issue. Sorry if I am
                              > misunderstanding things. As I learn, I want my work to look professional.

                              I bet you are loading cached version. Try to reload the page few times or clear
                              cache. Or perhaps upload not an updated file because with the given code by other
                              participant, it all should be working ok. It's a very straight forward thing and
                              there is no magic to it. Just some mistake somewhere on the way.

                              Best if you can upload the file to server and give us URL, we will check it out and
                              tell you whether it's just your end or global issue.

                              By the way, it could also be that some instance in your flash is white and is filling
                              up the background on stage.



                              --
                              Best Regards

                              Urami


                              --
                              "Never play Leap-Frog with a Unicorn."


                              <urami>
                              If you want to mail me - DO NOT LAUGH AT MY ADDRESS
                              </urami>
                              • 12. Re: White Box appears for a second before loading (Preloader?)
                                el pescado Level 1
                                Hey,
                                It worked!!! It turned out that I had to set the wmode transparent as well (whatever that is?). I now get a black background which looks waaaaaaaaay better. That white box was seriously making my stomach turn. I still have to better understand if I need a preloader. I really like Flash sites like this where you have one .swf dropped into HTML, so this was a great lesson learned.

                                This has been my first attempt at a forum and I really appreciate your help. Amazing. Thanks for following. I am sure you will see another posting very shortly. I'd rather be the new guy and have it come out correct.


                                • 13. Re: White Box appears for a second before loading   (Preloader?)
                                  Level 7
                                  el pescado wrote:
                                  > Hey,
                                  > It worked!!! It turned out that I had to set the wmode transparent as well
                                  > (whatever that is?). I now get a black background which looks waaaaaaaaay
                                  > better. That white box was seriously making my stomach turn. I still have to
                                  > better understand if I need a preloader. I really like Flash sites like this
                                  > where you have one .swf dropped into HTML, so this was a great lesson learned.

                                  Be careful tho, WMODE is suitable for none interactive movies. Like ads or simple
                                  animations. Once you have buttons and actions, the movie will fail to work correctly.


                                  --
                                  Best Regards

                                  Urami


                                  --
                                  "Never play Leap-Frog with a Unicorn."


                                  <urami>
                                  If you want to mail me - DO NOT LAUGH AT MY ADDRESS
                                  </urami>
                                  • 14. Re: White Box appears for a second before loading   (Preloader?)
                                    el pescado Level 1
                                    Hey,

                                    I tried emailing you but it is bouncing back for some reason. The animation seems to be working fine but I wanted to get some clarification about what you were saying. As mentiond, I basically build a separate swf for each page (home, contact, etc.) including buttons/navigation. This, instead of loading external swfs dynamically. I am hoping that is OK, I noticed some others do this as well. As I navigate from page to page.........the page takes a few seconds to load. I now have the white box gone so it looks pretty clean. I was going to build a preloader for each page but I am not sure that is necessary as the page loads fairly quickly.