[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

Load flash last

I need to load my flash movie last after the entire page loads. Please let me know what I need to do.
<script type="text/javascript">
                        /* You will need to complete this code here to get the region and pass it into the flash movie */
                        var region = String();
                        var xmlFile = String();

                        region = "<%= strFlashRegionDisplay %>";
                        xmlFile = "flash/regional-menus.xml";

                        CreateFlashObject("flashMovie",
                        "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",
                        "swfHome", "969", "320", "middle", "flash/home-splash.swf?menuRegion=" + region + "&xmlFile=" + xmlFile,
                        "FFFFFF", "-1");
                    </script>

Open in new window

0
pGustafson
Asked:
pGustafson
  • 3
  • 2
1 Solution
 
Kelvin McDanielSr. Developer/ConsultantCommented:
since that's just JavaScript you could always use jQuery and its .ready() event. the basic syntax is...

$(document).ready(handler)
Event Documentation: http://api.jquery.com/ready/

... so in your case you would want to do something similar to this...


<script type="text/javascript">
    $(document).ready(LoadFlashMovie()); 

    /* You will need to complete this code here to get the region and pass it into the flash movie */
    function LoadFlashMovie() {
        var region = String();
        var xmlFile = String();

        region = "<%= strFlashRegionDisplay %>";
        xmlFile = "flash/regional-menus.xml";

        CreateFlashObject("flashMovie",
        "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",
        "swfHome", "969", "320", "middle", "flash/home-splash.swf?menuRegion=" + region + "&xmlFile=" + xmlFile,
        "FFFFFF", "-1");
    }
</script>

Open in new window

0
 
pGustafsonAuthor Commented:
@azarc3 doesn't that load it first before the content on the page?
0
 
Kelvin McDanielSr. Developer/ConsultantCommented:
No. It won't load until the entire dome of the document itself has loaded.
0
 
Kelvin McDanielSr. Developer/ConsultantCommented:
err, that should be "... entire DOM of the document ..."
0
 
pGustafsonAuthor Commented:
worked great thank you
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now