#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    3
    Rep Power
    0

    Play Flash animation once on main page only


    Hi All,

    Any help would be greatly appreciated!

    I am setting up a webshop using opencart and I have replaced the logo with my Flash animation (created using CS5.5 trial & Act Script 3).

    The problem I am getting is when ever the a link is clicked the page reloads along with the header & logo which plays again, with each of these clicks!

    How can I make the logo just play once when someone visits the front page website.com/index.php ?

    Please, any advice would be terrific.

    Regards,

    osmildmay
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    3
    Rep Power
    0

    ... help NEEDED - BUMP


    ... if anyone can suggest it would be great ! ! !

    Have tried everything I can and every snippet of code I have found via google ...

    still no joy
  4. #3
  5. No Profile Picture
    Gotta get to the next screen..
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2003
    Location
    Legion of Dynamic Discord
    Posts
    6,675
    Rep Power
    3164
    Hi, you can use a SharedObject to do what you are after. You can think of it as a Flash based cookie. So on when the page is loaded you check if the SharedObject is set, if it is then you skip to the end of the animation, if it is not set then you just play it from the start. This is a rough version:
    Code:
    var header_so:SharedObject = SharedObject.getLocal("site_header");
    if(header_so.data.already_viewed)
       {
          // Skip to end of animation, you probably need to tailor this bit for your animation.
          this.gotoAndStop(20);
       }
    else
       {
          // Not viewed it yet so set the SO and continue the animation.
          header_so.data.already_viewed = true;
       }
    Quis custodiet ipsos custodes?

IMN logo majestic logo threadwatch logo seochat tools logo