Having flash header load only once per user visit.

Posted on 2007-08-05
Last Modified: 2008-01-31
We have a flash header that replays everytime the page loads. You can see it here: Is there a way to have it load once, then when a new link is clicked on the header, it doesnt load again? Thanks.
Question by:cwitr329
    LVL 23

    Expert Comment

    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)
    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.


    LVL 10

    Expert Comment

    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.

    LVL 9

    Accepted Solution

    If you don't like frames (as I) try using session cookies and flashvars to control your animation.

    // 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";}

    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:
      // Play the animation
     // Don't

    Best, Jakob E

    Expert Comment

    Jakob, few questions...

    Do you do this all on a php page or a html  page? Where exactly do you put the the head tag? I'm having a similar issue at


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    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 select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
    Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now