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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advice needed on site idea

Status
Not open for further replies.

georgeocrawford

Technical User
Aug 12, 2002
111
GB
Hi guys,

Wondering what people think of this idea. I want to start my index page with a flash splash-screen, with the rest of the page automatically loading after the animation finishes.

Easy, sure (the GetURL command), but I want to try and avoid the screen flicker you get when the new page loads.

I thought to myself what if the whole page had already loaded? Load the whole page, with everything except the flash movie hidden using a style sheet. Then get the movie to trigger a JavaScript function on its completion, which changes the style shet.

My effort is here:


The JavaScript function is called with the line

Code:
getURL("javascript:change_style('style2')");

in the flash file.


Wondering what your thoughts are: is this going to cause problems with compatibility, or should I be safe? I've tested on as many browsers as I have, and it works great, but I would love some input if you have any old browsers!

Also, is there a better way of doing what I'm aiming for? I want to produce the most sensible, reliable and thought-out final result that I can!

Thanks for your help.

______________________

George
 
Well, I'd never use Flash for anything... and I'd never put a splash-page on my site for any amount of cash. Ah, well, those are personal opinions that don't have anything to do with your conundrum...

To do what you're after, try writing your page-content into a div with "display" set to "none", like:
Code:
<div id=&quot;htmlContent&quot; style=&quot;display:none;&quot;>
My content... how'd you like my Flash animation? Irritating, eh?
</div>
Then put your Flash ani-mutation into another div, like:
Code:
<div id=&quot;flashiness&quot;>
flash stuff here... not my milieux.
</div>
Put a javascript function in your header, like:
Code:
function swapDivs{
  document.getElementById('flashiness').style.display = 'none';
  document.getElementById('htmlContent').style.display = '';
}
When Flash is done annoying people, call the javascript function. With any luck, the FlashDiv will disappear, and the HTML div will appear.

Give it a try.

The cool thing about toggling the &quot;display&quot; attribute is, when &quot;display=none&quot;, the content is both invisible AND the SPACE REMAINS UNRENDERED... so it doesn't block out space for itself, like with the Visibility setting.
 
Your missing the point that flash takes a lot longer to load than most websites... That why most stupid into pages have a &quot;skip intro&quot; and there intros have a preloader (to amuze people while the FLASH loads). Flash has it's place, splash screens have their place, and I don't think this is the time for either. Flash says to people without the flash plugin that &quot;they don't want me arround, because 'I'm not with it'&quot;... The time to use flash is for multimedia purposes, apps and games (where you warn the user that the feature requires it). Splash screens are best when you have two versions of a site (read: frames and w/o frames, flash and non-flash)... But all a Flash intro does is slow the time it takes to get to your content. Sorry, just my humble opinion.

Using the javascript, I'll leave that rant to a later date.

That said, if you still want to do it... Another way to do it would be to popup another window for the flash (hey, your using javascript and flash already, why not pop-ups too?) the exsact same setting as the first (hieght, width and postion) and then have javascript kill the window when the movie finishes. It's not as neat as Mr3putt... but at least this allows me to avoid loading the huge movie to see the tiny HTML site (by allowing me the option of using my popup blocker).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top