[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Having flash header load only once per user visit.

Posted on 2007-08-05
4
Medium Priority
?
1,273 Views
Last Modified: 2008-01-31
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.
0
Comment
Question by:cwitr329
4 Comments
 
LVL 23

Expert Comment

by:Zeffer
ID: 19636298
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
 
LVL 10

Expert Comment

by:najh
ID: 19637928
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
 
LVL 9

Accepted Solution

by:
Jakob_E earned 2000 total points
ID: 19638246
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
 

Expert Comment

by:hoff_man
ID: 20786163
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question