Having flash header load only once per user visit.

We have a flash header that replays everytime the page loads. You can see it here: http://www.phyllisgoldie.com/index.php. Is there a way to have it load once, then when a new link is clicked on the header, it doesnt load again? Thanks.
cwitr329Asked:
Who is Participating?
 
Jakob_ECommented:
If you don't like frames (as I) try using session cookies and flashvars to control your animation.

<?php
// If no session cookie named showanimation exists create one
// with a true value. Else set the the value to false
if(!isset($showanimation)){ $showanimation="true";}
else{ $showanimation="false";}
setcookie("showanimation",$showanimation,0);
?>

Add the following to the tags including your flash movie on the page:
Object tag:
<PARAM NAME=FlashVars VALUE="playanimation=<?=$showanimation ?>">

Embed tag:
<EMBED src="yourflashfile.swf" FlashVars="playanimation=<?=$showanimation ?>"
... (other parameters)></EMBED>


In your flash movie add something like this:
if(playanimation){
  // Play the animation
}else{
 // Don't
}

Best, Jakob E
0
 
ZefferCommented:
I like flash for it's seamless presentation..and having a flash movie load with each new page seems to me..contrary to what flash is good for.
because you're using it as a menu there are two easy ways to make it just sit there and not re-load.
1. put the flash movie and the content below the movie in separate frames
 (the most appropriate solution considering the approach you have taken..note.. the variables you are passing in the html to set the buttons to match the page will no longer be needed)
or
2.include the bottom content in the flash movie so your site is a one flash movie (my favoured option) but 1. will work just as well.

Z


0
 
najhCommented:
Oh my! I hate to be critical, but that flash thing is really rather busy! Anyway you didn't come here to discuss that but to solve your problem.

As zeffer says, frames is one solution and putting the content at the bottom into the flash movie itself would also work.

The alternative is to have some variable written by the php which controls what's going on in the flash movie - so you could read in a value from the params bit of your html definition which would tell your movie whether to do the whole "slide the boxes around" bit - and to be honest, you could even turn off the "loading" bit with this as presumably it will be cached by this point.

0
 
hoff_manCommented:
Jakob, few questions...

Do you do this all on a php page or a html  page? Where exactly do you put the code...in the head tag? I'm having a similar issue at http://andrewhoffmandesign.com/evolved


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.