Play only once movie using LSO script

I have just put together a website for my employer which has a flash movie that plays as soon as you land on the homepage. I want that movie to only play once, so when the visitor goes to another page then goes back to the homepage the movie will not play again. I have applied the following LSO script to the flash movie to create a sort of flash cookie stored on the visitors computer. It works fine in Internet explorer and Safari, but for some reason there's a problem in Firefox. When you go back to the homepage, instead of going to the last frame as scripted gotoAndStop(_totalframes); it stops at a random point roughly half way through the movie. I have no idea why this is happening, does anyone have any suggestions how to resolve the problem?
Actionscript:
// create a Shared Object
var my_so:SharedObject = SharedObject.getLocal("animationPlayed");
// if it's the first time here, i.e, <em>played</em> hasn't been set already,
// see the animation
if (my_so.data.played == undefined)
     // set played to true
     my_so.data.played = true;
     my_so.flush(); // write the data
else
     // you've already watched the animation before
     // go to the last frame
     gotoAndStop(_totalframes);
// for testing purpose, clear the Shared Object, i.e.,
// pretend you haven't watched the animation already
clearLSO_btn.onRelease = function()
     my_so.clear();
Also, how long will this flash cookie be stored on the visitors computer? Can you suggest the script I can use to clear this data after a certain period of time?
Thanks  

normally that indicates a swf has not completely loaded.  i would expect, if you cleared your other browser's cache, you would see the same issue when clicking back and forth quickly enough.

Similar Messages

  • Animated gif plays only once

    I am using Captivate 5.5 on a Windows machine. I inserted an animated gif into my Captivate, using insert > animation...  Then, I inserted a button. When I pressed F4 to preview the animation, it played only once. I put a check mark on the loop on the timing of the properties of the animation. Still, it played only once. It stopped when the play head stoped moving. I cannot make the animated gif play continuously. Does anybody know how to make the animated gif play continuously?
    thaks.

    You can try this:
    Stick this in the header area of your code
    <script type="text/javascript"> function showBuyLink() {
    document.getElementById("buylink").style.visibility = "visible";
    } // adjust this as needed, 1 sec = 1000
    setTimeout("showBuyLink()", 5000);
    </script>
    Stick this around your buy link code.
    <div id="buylink" style="visibility: hidden"> <!-- put all your add to cart buy links and images inside this hidden div --> <p style="text-align:center; font-size:26px;"> <a href="http://mybuylink">Add to Cart or Buy Link</a> </p> </div>
    Yopu can rename "buylink", but you have to make sure you rename all instances or it will kill the script.
    If you're not comfortable incorporating that, unfortunately, the other option would be to create a Flash animation and put a button in the last frame.
    That would be just as difficult (if not worse) as writing (or tweaking) a javascript to delay the hotspot, and even worse because it would be invisible to phone users. Additionally, people who disable javascript would never see the link if you did add the script.
    There isn't any way to do this with HTML or CSS, and you now know the flaws with the methods that will work.

  • Making symbol play only once

    Hello,
    I am new to Adobe Edge and I wonder if I can make my symbol play only once on mouseover. I want a picture to appear only when mouse finds it and stay there (I made a symbol in which there's animation of picture appearing from white). Now I only managed to make it appear when it's mouse over, but when my mouse is over the same area again, it plays over again and looks like blinking.
    Thank you.

    Hi, Winrry-
    You might also want to try using mouseenter instead of mouseover.  Mouseover also fires when you move the mouse, so you'll get some hiccuping/flickering as you mentioned.
    Thanks,
    -Elaine

  • Can a drum pattern created in Ultrabeat be limited to playing only once? Basically creating a single bar.

    Can a drum pattern created in Ultrabeat be limited to playing only once? Basically creating a single bar.

    Found it. The key is shutting down the sequencer in Ultrabeat once you have dragged the pattern to the arrange window.

  • Inventory movement using logic script - BPC NW 10

    Hello BPC experts,
    I'm working on inventory movement using logic script. The idea is that the initial stock of the first period equals the final stock of the previous period.
    Here is an example of my inventory report : (Dimension INVT in function of dimension TIME)
                                                  2014.01       2014.02      2014.03        2014.04
    F01 Stock first period                  12            
    F02 Initial Stock                          12                 11              10                 9
    F03 Inventory Inputs                    2                   4                6                   8
    F04 Inventory Outputs                 3                   5                7                   9
    F05 Final Stock                          11                 10               9                   8
    The Stock of the first period is entered
    The initial Stock = Stock first period (12 in our case)
    Inventory inputs and Outputs are entered
    Final Stock = Initial Stock + Inventory Inputs - Inventory Outputs
    I tried the following script but it does not work :
    *XDIM_MEMBERSET TIME = 2014.01 //we should then retrieve the first period of each year which is not necessary the first month of the year
    *WHEN TIME
    *IS 2014.01
    *REC(EXPRESSION = [INVT].[F01], INVT = F02)
    *ENDWHEN
    *SELECT(%TIME_LIST%,"[ID]","TIME","[PREVMEMBER]"<>"") // PREVMEMBER is a property of TIME
    *XDIM_MEMBERSET TIME = %TIME_LIST%
    *XDIM_MEMBERSET INV = F05
    *WHEN TIME
    *IS %TIME_LIST%
    //Something is missing here.. How to retrieve F05 values related to all periods and copy them in F02
    *REC(EXPRESSION =[INVT].[F05],INVT = F02)
    *ENDWHEN
    Please how can I achieve this ?
    Thanks
    Maha

    Hi Vadim,
    Thank you for your reply
    I'm working with BPC NW 10 SP 05 (CPMBPC 801 SP 05), Engine ABAP
    My model contains the following dimensions ACCOUNT (A), TIME (T), CATEGORY (C), ENTITY (E), CURRENCY (R), INVT (User Def)
    In the INVT dimension we have members like (Stock first period, Initial Stock, Inventory Inputs, Inventory Outputs, Final Stock)
    - [INVT].[Stock first period] is entered
    - [INVT].[Initial Stock] = [INV].[Stock first period]
    - [INVT].[Inventory input] and [INVT].[Outputs] are entered
    - [INVT].[Final Stock] = [INVT].[Initial Stock] + [INVT].[Inventory Inputs] - [INVT].[Inventory Outputs]
    We want to calculate Initial Stock in DEFAULT.lgf :
    [INVT].[Initial Stock] when (TIME=2014.01) = [INVT].[Stock First Period] when (TIME= 2014.01)
    [INVT].[Initial Stock] when (TIME=2014.02) = [INVT].[Final Stock] when (TIME= 2014.01)
    [INVT].[Initial Stock] when (TIME=2014.03) = [INVT].[Final Stock]  when (TIME=2014.02)
    [INVT].[Initial Stock] when (TIME=2014.04) = [INVT].[Final Stock]  when (TIME=2014.03)
    When a user enters the values of "Stock first period", "Inventory Inputs" and "Inventory Outputs", Initial Stock and Final stock should be calculated via logic script
    Regards
    Maha

  • How to hide layers or movies using Action Script

    Hi All,
    I am using a few layers and would like to hide a specific
    layer using action scripts - I guess I dont mind doing it as a
    movie clip too (hiding the movide clip).
    Also I am interested in controling the final *.swf via an
    external command to hide that layer or movie clip. How do I do
    that?
    Thanks in advance,
    Steven

    rsagi: Layers are only layers while you are editing the fla.
    When compiled, layers are merged. I think the best way would be to
    use movieclips as containers and hide the "container movieclips".
    jlucchesi: from fl8_as2lr.pdf:
    "The alpha transparency value of the movie clip. Valid values
    are 0 (fully transparent) to 100
    (fully opaque). The default value is 100. Objects in a movie
    clip with _alpha set to 0 are
    active, even though they are invisible. For example, you can
    still click a button in a movie clip
    whose _alpha property is set to 0. To disable the button
    completely, you can set the movie
    clip's _visible property to false."

  • Play only once

    I have 1 Joomla template for my client. He wants a flash banner of looping rotating images on 1 layer and then on the next layer on top he wants himself speaking.
    However I just need him speaking once per sesion whilst the gallery is still looping within the template page
    Is this possible?

    not if the audio is attached to the timeline.
    use the sound class to play the audio and use a boolean variable to prevent the sound code from re-executing:
    var soundStarted:Bool;
    if(!soundStarted){
    soundStarted=true;
    var s:Sound=new Sound(this);
    s.attachSound("soundID");  // assign linkage id
    s.start();

  • Using flash shared object to have a load animation play only once

    Hey all I have a swf on multiple pages, I onyl want it to
    play the load animation once, so I thought I would try the shared
    object to do this.
    //On frame 1 on my mc if it hasnt played the file below it
    should to gotoAndPlay frame 1 of my mc, logo_mc
    logoload = SharedObject.getLocal("logoload1");
    if (logoload.data.logoloadvar == undefined){
    _root.logo_mc.gotoAndStop(30);
    } else {
    _root.logo_mc.gotoAndPlay(1);
    stop();
    //at the end of my load animation frame 30 of logo_mc I am
    trying to tell the shared object that its has played, so I put
    something in it:
    stop();
    computer = System.capabilities.os;
    _root.logoload.data.logoloadvar = "logoseen";
    _root.logoload.flush();
    But it does not appear to be responding, what am I doing
    wrong there? Its the first time Ive used the object.
    Any help would be great.

    Wow. That is exactly what it was, thanks so much. Our IT guys are working on the problem now. Thanks again.

  • How can I stop a sound from looping so it plays only once each time the up key is pressed?

    Hi there here is my code, the basis is it is playing a mp3 from my library.
    Basically as the topic suggests I only want the sound to play once each time the UP arrow key is pressed. At the moment when you hold the up arrow down the sound keeps triggering and looping and gets really loud and noisy.
    Here is my code for my game:
    package com.chasegame.components
              import flash.display.MovieClip;
              import flash.display.Stage;
              import flash.events.Event;
              import com.tech.utils.KeyObject;
              import flash.ui.Keyboard;
              import flash.media.Sound;
              import flash.media.SoundChannel;
              public class SpaceShip extends MovieClip
                        private var key:KeyObject;
                        private var speed:Number = 0.3;
                        private var rotateSpeed:Number = 5;
                        private var vx:Number = 0;
                        private var vy:Number = 0;
                        private var friction:Number = 0.95;
                        private var shipSound:roar = new roar();
                        private var shipSoundChannel:SoundChannel = new SoundChannel();
                        public function SpaceShip () : void
                                            key = new KeyObject(stage);
                                            addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
                        public function loop(e:Event) : void
                                            if (key.isDown(Keyboard.UP))
                                                           vy += Math.sin(degreesToRadians(rotation)) * speed;
                                                           vx += Math.cos(degreesToRadians(rotation)) * speed;
                                                           shipSoundChannel = shipSound.play();
                             else
                                                           vy *= friction;
                                                           vx *= friction;
                                  if (key.isDown(Keyboard.RIGHT))
                                            rotation += rotateSpeed;
                                  else if (key.isDown(Keyboard.LEFT))
                                            rotation -= rotateSpeed;
                                  y += vy;
                                  x += vx;
                                  if (x > stage.stageWidth)
                                            x = 0;
                                  else if (x < 0)
                                            x = stage.stageWidth;
                                  if (y > stage.stageHeight)
                                            y = 0;
                                  else if (y < 0)
                                            y = stage.stageHeight;
                        public function degreesToRadians(degrees:Number) : Number
                                  return degrees * Math.PI / 180;

    If you want the sound to only play once when the key is pressed then you don't want to have it in the ENTER_FRAME event handler like you have it.  It is starting new sounds at the frame rate of your file the way you have it now.
    Try having an event listener dedicated to a KeyboardEvent.KEY_DOWN event where you detect when the UP key gets pressed and use that to trigger playing the sound.

  • YouCam video won't play - only audio. Used link from apps page. Can see screen capture.

    Hi there,
    We recorded a 1 minute video using Cyberlink Youcam (the one on the 8.1 apps page, as opposed to the one with shortcut on the main desktop page - Youcam5.) We can see te screenshot of the video, and hear the audio for entire duration of recording, but the video screen is only green. Help please!
    Amber
    This question was solved.
    View Solution.

    Hi @amberdag,
    Welcome to the HP Forums!
    I would like to take a moment and thank you for using the forum, it is a great place to find answers. For you to have the best experience in the HP forum, I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I understand that when you tried to playback your recording from YouCam 5, you can hear the audio, but the screen remains green.
    Have you done all your Windows updates?
    Is you Direct X, Adobe flash player and or Direcrt X up to date?
    Here is a link to How To Fix Green Screen Video Playback in YouTube in Windows 8.1 (from social.technet.microsoft.com) that should help you to overcome this issue.
    Here is a YouTube video that may also aid with this difficulty.
    YouTube Green Screen Playback Problem FIX
    Please let me know the outcome.
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • ITunes can play only once, then I need to quit in order to play again.

    Hi
    I have lots of video to play, one day I couldn't play my video without quitting iTunes first. Now whenever I want to play a video, I need to quit iTunes because I didn't quit from after the previous time that I was playing a video clip from my library. I have reinstalled iTunes without effect. How can I solve this problem?
    Thanks,
    -Jack

    This problem has been solved.

  • SharedObject, using it to play an intro animation only once

    Hi all,
    Having some difficulty getting my sharedobject to operate.
    All I am trying to do is have my intro animation play only once, so
    that I can use the same swf on multiple pages without showing the
    intro animation every time.
    If the 3rd page was viewed first the intro animation would
    play but then if the 2nd page was viewed the intro animation would
    not play (because it was already played on page 3).
    My code:
    logoload = SharedObject.getLocal("logoload1");
    if (_root.logoload.data.logoloadvar == undefined){
    _root.logo_mc.gotoAndPlay(1);
    } else if (_root.logoload.data.logoloadvar == "logoseen") {
    _root.logo_mc.gotoAndStop(31);
    stop();
    //_root.logo_mc //My trigger to say the intro has been played
    computer = System.capabilities.os;
    _root.logoload.data.logoloadvar = "logoseen";
    _root.logoload.flush();
    stop();
    File here
    http://users.ncable.net.au/~timfranc...red_object.fla
    If someone could please help would be much
    appreciated.

    That would explain it.
    I got around it by passing a variable through the querystring
    to flash solution using some if statements.
    But I also now have a difficulty doing it that way because of
    this active content fix I am using, my post for that is here.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=288&threadid=1162386&en terthread=y
    If you could take a look. Thanks again for the help.

  • Download iOS 8 once and use it to upgrade all iPads in the network

    Is it possible to download iOS8 only once and use it to upgrade all iPads in the same LAN? 
    I tried the following methods and they are just not working:
    1. Connect an iPads Mini with Retina Display to the iTunes on Mac.  I chose Download Only. Once downloaded the iPad Software Upgrade, I upgraded the connected iPad to iOS8.  Then I connect another iPad (used to be on another Mac) to the same iTunes.  I had to download iOS 8 again.  It's not using the same downloaded iOS 8 file.
    2. I turned on the Caching Service (not Software Upgrade Service, i.e. for Mac Software) on the Mac Mini Server from the Server app.  I then repeat step 1 above and got the same result.  It seems that the Caching Service does not cache the iOS 8  Software Upgrade like what it does for other apps.  (I think I may need to use some Apple Scripts but I have no such experience.)

    Ivan H wrote:
    It's for the family.  Every member has 2-3 iOS devices to upgrade.
    I agree with Csound on that, a family, even with a lot of devices will have to individually update.  There are enough nuances in the iOS for different devices that you need to download for each.  If you had 200 iPad 2's then there might be an enterprise way...but not a family with a mix of devices.

  • What to do?? -What to do?? - I just updated my iTunes to ver 11.2.1 because of the annoying messages they keep sending out. Now I can't play the movies and TV series I've purchased and were watchable before - This movie can be played only on displays that

    What to do?? - I just updated my iTunes to ver 11.2.1 because of the annoying messages they keep sending out.
    Now I can't play the movies and TV series I've purchased and were watchable before.
    Comes up with "This movie can be played only on displays that support HDCP (High-bandwidth Digital Content Protection)."
    The cheek of the matter is everytime I tried to get Apple support it comes up with a request for me to pay $54 for their support package, to fix a problem I didn't have until I complied to one of their update requests.
    End of Rant!!! - Anyone know how to fix please?

    Well, I wonder about all the responses...:)
    Anyhow, I wound up "fixing" the problem by using the System Restore disks for the Mini. It's now running Tiger 10.4.11 (with all updates) and I copied my iTunes library over. It all works now. <shrug> I have no idea what the problem was, and I'm a bit leery of upgrading it to Leopard, so I think I'll just leave well enough alone.
    Richard

  • A few months ago, I purchased a new iMac. I recently created a movie using iMovie. Then I found out that iDVD is not included. So I have the problem that I want to burn a movie that I can play on my DVD player and watch on a television. i rang Applecare a

    A few months ago, I purchased a new iMac. I recently created a movie using iMovie. Then I found out that iDVD is not included. So I have the problem that I want to burn a movie that I can play on my DVD player and watch on a television. I rang Applecare and was told that I need a program called BURN.
    Is this correct? I can export the movie from iMovie in a m4v format, but I think I need to convert this to iso format before I can burn the disc.
    I know there are programs like TOAST that will do this, but it is expensive.
    I would be very grateful for any assistance.

    Burn will not do what you want, and there is no real substutute for iDVD.
    Why is there no iDVD on my new Mac?
    Apple insists that the entire world has access to fast broadband (and are prepared to pay for the considerable bandwidth usage) and wants to distribute home movies to friends and relatives via download (iCloud, YouTube, Facebook, whatever) rather than mailing them a DVD. The fact that in reality not all users do, has so far had no effect on this policy. If you scream and shout loudly enough down the phone Apple may send you a free copy of iDVD. Stating that they would return their brand new Mac unless they received a copy of iDVD worked for some, but that is now said to have been withdrawn by Apple.
    Also, you can complain bitterly via Apple’s Feedback link, perhaps suggesting that Apple could have provided a choice between burning DVDs and distributing home movies by other means. You may feel that Apple should not dictate how you destribute family videos or photos to distant relatives and friends, and should not assume that every user is prepared to pay for the excessive bandwidth usage charged by ISPs for huge downloads from the App Store:
    http://www.apple.com/feedback/
    Whilst Macs with a Superdrive continue to be able to burn video DVDs, the software for so doing, iDVD, is no longer included in the iLife bundle that came with OS 10.7 Lion (which also omitted iWeb) or that comes with OS 10.8 Mountain Lion. And it is no longer included in the iLife 11 from the online Apple Store: http://www.apple.com/ilife/. Your only solution is to look on Amazon or eBay and try to get an older version that includes iDVD 7, i.e. iLife version 9 onwards. You should also do this if you plan to buy a new Mac anytime soon, as stocks of iLife that include iDVD will not be available for ever.
    However, the vastly more expensive FCPX can burn a DVD without iDVD or DVD Studio Pro involvement, but lack the themes etc of iDVD. Also, of course, there is Roxio Toast, which is the best software for burning anything but again does not offer the flexibility of iDVD.
    And if you think Microsoft are any better, their new Windows 8 operating system will not play DVDs, or burn them, unless customers buy an extra upgrade, the company has announced:  http://www.gizmag.com/windows-8-no-dvd-playback/22443/
    In other words, computer manufacturers have declared optical media as dead, long before consumers are ready to stop using them, which is fine as long as they offered us a choice, but they won’t even do that. Flexibility and intuitive use of a computer seems to be a thing of the past.

Maybe you are looking for