Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash Intro/ Iframe Help

Status
Not open for further replies.

silentq

Programmer
Sep 17, 2007
16
CA
Hi,
what I'm trying to do is have a short flash intro play while my site loads, and once its done, replace the intro with the content of the index page. I'm using iframes to show the content of the home page and the flash movie. This is what I have:

(index.php)
Code:
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL] <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> 
</head> 
<body onload="introReplace"> 
<div id="flashIntro"> <iframe src="intro2SEC.html" name="theIntro" width="600px" height="600px" scrolling="No" frameborder="0"></iframe> </div> 
<script language="javascript"> 
function introReplace () { document.getElementById('flashIntro').innerHTML = homepage.document.getElementById('content').innerHTML; } </script> 
<iframe name="homepage" src="index2.php" width="0" height="0" frameborder="0" scrolling="no"></iframe> 
</body> 
</html>

and in index2.php, where all the content of the site is:
Code:
<div id="content"> 
// 
// 
// 
// * HOME PAGE CONTENT * 
// 
// 
// 
</div>

I'm not sure why it doesn't work. I figured that putting the "introReplace" function into the body onLoad attr. would replace the intro movie with the page once it finished loading... Any Advice appreciated.
 
Doesn't it take longer for the Flash intro to load than for the main page content to load?

Try the following:
Code:
document.getElementById('flashIntro').innerHTML = document.frames['homepage'].document.getElementById('content').innerHTML;

You said it doesn't work, but gave NO details about what it does, or what doesn't work.

Lee
 
Ok, sorry for being unclear.
What it does, or is upposed to do is:
When the website first opens, the intro flash movie plays, once the site has stopped loading, the movie is replaced by the home page.

this is what is actually happening:
when you go to the site, the intro movie plays, and once it is done, nothing happens. It just stays there,(at the end of the flash movie) and doesn't open the index2.php content.

so what doesn't work is the function introReplace.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top