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

pGustafsonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.