6 Replies Latest reply on Dec 18, 2006 10:50 AM by razx

    preload an html

    razx
      hi everyone! i made a page in CSS with 3 frames in each frame a load a swf in total 3 the topmenu.swf, rightmenu.swf and content.swf ok everything works fine, i just want to make a progress bar that loads the entire page i mean the 3 swf but the best way for me would be that it can load the index.html file cause i want the 3 swf to appear at the same time when it finish loading. hope you guys can help me=) thank u!!
        • 1. Re: preload an html
          kglad Adobe Community Professional & MVP
          you could make a preloader file that downloads your 3 swfs (into the user's cache). when that's complete you could open index.html (which i assume contains your frameset) with getURL() and the 3 swfs would appear to load quickly and simultaneously.
          • 2. Re: preload an html
            razx Level 1
            i see! so how can i do that? can you show me and example code please=) thanks again!
            • 3. Re: preload an html
              kglad Adobe Community Professional & MVP
              in your preloader you can use:

              • 4. Re: preload an html
                razx Level 1
                hi thanks for the code =) but i can´t figure it out how to use it=( this is the code that i use for the preloader so please tell me what to do:

                myProgressBarListener = new Object();

                // When the progress bar is complete and has preloaded the loader component content, the listener will call and run this code below:
                myProgressBarListener = function (eventObject) {

                // Hide the progress bar now as we don’t need it any more
                myProgressBar._visible = false;

                // Closes the above function
                };

                // Sets whether the content being loading into the loader component scales to fit the loader (true), or the loader scales to fit the content (false)
                myLoader.scaleContent = true;

                // Set the location of the content to be loaded. Examples are:
                myLoader.contentPath = "index.html"; //this is the problem=(

                // Declares a listener that detects when the progress bar component has loaded the loader component content and is complete. Then calls the function myProgressBarListener
                myProgressBar.addEventListener("complete", myProgressBarListener);

                // Set up the progress bar component variable to polled mode which determines the maths behind the % counter.
                myProgressBar.mode = "polled";

                // The location of the Loader Component
                myProgressBar.source = "myLoader";

                // Sets the conversion to 1. This basically means the component divides the current and total values loaded and to be loaded. Then it floors them (works out the difference between them) and displays the converted value in the label property
                myProgressBar.conversion = "1";

                // Set the label to display the word 'loading' followed by the percentage value loaded so far
                myProgressBar.label = "LOADING %3%%";

                // The direction the progress bar moves when loading
                myProgressBar.direction = "right";

                // The location of the label that displays the percentage loaded so far
                myProgressBar.labelPlacement = "bottom";

                // Stops the Playhead in the current frame until the Movie has been preloaded
                stop();

                thanks for your time!
                • 5. Re: preload an html
                  kglad Adobe Community Professional & MVP
                  what's the html code for index.html?
                  • 6. Re: preload an html
                    razx Level 1
                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    <html xmlns=" http://www.w3.org/1999/xhtml">
                    <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                    <title>Simas San Pedro</title>
                    <style type="text/css">
                    <!--

                    body {
                    margin: 0;/* without margins the page would be stuck to the sides*/
                    font-family: verdana, arial, sans-serif; /* base font is defined in the page */
                    font-size: 12px; /* size font is defined in the page */
                    background-color:#000000
                    }
                    #topbanner {
                    left:0px;
                    width: 754px;
                    height: 118px;


                    }
                    #topbanner1 {
                    left:0px;
                    width: 754px;
                    height: 118px;
                    overflow: auto;
                    }

                    #right {
                    position: absolute;
                    /*right:16px; /* the left block is placed in absolute position to the left */
                    width: 204px;
                    height: 448px;

                    }

                    #center {
                    position: absolute;
                    margin-right: 204px; /* the center block is placed according to the left block's width */
                    #Layer1 {
                    position:absolute;
                    width:200px;
                    height:115px;
                    z-index:1;
                    left: 0px;
                    top: -2px;
                    }
                    -->
                    </style>
                    </head>

                    <body>
                    <div id="topbanner">
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" name="top" width="754" height="118" title="top">
                    <param name="movie" value="topbarlight.swf" />
                    <param name="quality" value="high" />
                    <embed src="topbarlight.swf" width="754" height="118" quality="high" pluginspage=" http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="top"></embed>
                    </object>
                    </div>
                    <div id="right">
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" name="right" width="204" height="448" title="rightBanner">
                    <param name="movie" value="rightblt.swf" />
                    <param name="quality" value="high" />
                    <embed src="rightbar.swf" width="204" height="448" quality="high" pluginspage=" http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="right"></embed>
                    </object>
                    </div>
                    <div id="center">
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" name="center" width="550" height="448" title="Content">
                    <param name="movie" value="centerlt.swf" />
                    <param name="quality" value="high" />
                    <embed src="center.swf" width="550" height="448" quality="high" pluginspage=" http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="center"></embed>
                    </object>
                    </div>
                    </body>
                    </html>