2

I have a webpage which has three portions. The first portion is a flash file, and the other two being images.

Now what happens is, when the webpage is opened, the images gets downloaded faster than the flash, so for some time I could see the bottom potion of the page being displayed while the flash is only observed after a while. But I want the flash to be displayed first before any other part of the page.

I want to know whether I could prioritize the content being downloaded i.e first flash & then the images.

OR

If no such method exists, is there any way I could keep the images hidden until the flash is loaded.

Thanks, Narain

2 Answers2

2

Possible solution is to hide all images initially (display:hidden or even do not print HTML for them), and load them in onLoad javascript method (i.e. when other loading is done). Ofcourse users without JS will not see images at all. :-)

BarsMonster
  • 6,483
  • 2
  • 34
  • 47
0

Not sure what the problem is but if it about the page being broken you can also define the height and width of the flash element so even before it has loaded the browser makes a space for it.

If it is because you really want the flash first and only then the user sees some 'give away' image you should go with JS.

I found this at yaldex but it preloads the whole page

<script language="javascript" type="text/javascript">
    /* Visit http://www.yaldex.com/ for full source code
    and get more free JavaScript, CSS and DHTML scripts! */
    <!-- Begin
    function loadImages() {
    if (document.getElementById) {  // DOM3 = IE5, NS6
    document.getElementById('hidepage').style.visibility = 'hidden';
    }
    }
    window.onload = loadImages;
    //  End -->
    </script>
    <div id="hidepage" style=" background-color: #FFFFCC; layer-background-color: #FFFFCC; width: 100%;">
    <table width=100%><tr><td>Page loading ... Please wait.</td></tr></table></div>

alternatively you can try something like this but use the flash file

<SCRIPT LANGUAGE="JavaScript">

Image= new Image(60,50)
Image.src = "image.gif"

</SCRIPT>
Ross
  • 1,013
  • 14
  • 32