SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Iframe/Flash intro Problem

    Hi,
    What I'm trying to do is have a short intro movie clip play while my site loads the home page. Once the home page finishes loading I want the intro movie to disappear and the home page to appear. The way I'm trying to do it is load the home page in a hidden iframe, and then use getElementById to switch the flash movie code with that of the home page.
    this is what I have:

    Code:
    <body onload="introReplace ()">
    <script language="javascript">
    function introReplace () {
    document.getElementById('flashIntro').innerHTML = document.getElementById('homepage1').innerHTML;
    document.getElementById('flashIntro') = null;
    
    }
    </script>
    .
    .
    <div id="homepage1">
    <iframe name="homepage" id="homapage" src="index2.php" width="500" height="500" frameborder="0" scrolling="no"></iframe>
    </div>
    .
    .
    <div id="flashIntro">
    //** INTRO.SWF ** // this is where the intro is
    </div>
    </body>
    This is the problem: The iframe content appears before the movie has completly finished, and the movie doesn't disappear when finished playing.

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about moving the homepage into a hidden div, and showing the movie div. Then, onload, you can hide the movie and show the page.
    Code:
    <html>
    <head>
    <script type="text/javascript">
    window.onload = function () {
    	document.getElementById("flashmovie").style.display = "none";
    	document.getElementById("therealhomepage").style.display = "block";
    }
    </script>
    </head>
    <body>
    <div id="flashmovie">...</div>
    <div id="therealhomepage" style="display:none">....</div>
    </body>
    </html>

  3. #3
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. That makes more sense, or is much easier to do at least than the way I had in mind. Much appreciated.

    -SilentQ


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •