Only play on first load?

Hello!
I'm embedding a .swf file into my home page, very small and simple.
However, I only want this movie to play the first time someone visits that page — after that, I'd like to swap out for a static image — or just not have the movie play.
Anyway to do this?
d

I actually just did this for a project recently.
You'll need to use javascript to add a cookie to the browser. Then with javascript you can control what you want to show up.
You'll want to change the 7 in the following line to something longer if you want it to last longer than 7 days.
setCookie('visit',visit,7);
You can use this code and just replace the bottom couple lines to make them do what you want it to do. I use SWFObject inside that IF-statement to display different content.
<script language="JavaScript" type="text/javascript">
    setupMovie(checkCookie());
    function setCookie(c_name,value,expiredays)
        var exdate=new Date();
        exdate.setDate(exdate.getDate()+expiredays);
        document.cookie=c_name+ "=" +escape(value)+
        ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
    function getCookie(c_name)
        if (document.cookie.length>0)
            c_start=document.cookie.indexOf(c_name + "=");
            if (c_start!=-1)
                c_start=c_start + c_name.length+1;
                c_end=document.cookie.indexOf(";",c_start);
                if (c_end==-1) c_end=document.cookie.length;
                    return unescape(document.cookie.substring(c_start,c_end));
        return "";
    function checkCookie()
        visit=getCookie('visit');
        if (visit!=null && visit!="")
            //alert('Welcome again '+visit+'!');
            return true;
        else
            visit='visited';
            if (visit!=null && visit!="")
                setCookie('visit',visit,7);
                return false;
    function setupMovie(cookieExists)
          if(cookieExists)
               // Load SWF and Preview it
          else
               // Show alternative content like a JPG or set the SWF's autoplay to false;
</script>

Similar Messages

  • My iPod classic only plays the first two minutes of some of the songs i have transferred. I cannot work out a theme here

    I recently bought an ipod classic - and loaded my full itunes library.
    Most of the songs loaded fine - but a significant minority (c 25%) only play the first 2 mins, after which are silent for the rest of the song. I have not managed to identify a common theme among these
    When i play the songs from itunes direct, it's fine - or from my ipod when plugged in. It only happens when i play my iPod offline
    I have itunes on an iMac

    I've been having this same problem since I installed version 8.1 of iTunes. I have tried EVERYTHING to no avail, oh wait, things got worse. At first it was only songs I had downloaded since installing version 8 but now songs I rip from my CDs are skipping as well.
    The only songs I have on my iPod are from iTunes or my own CDs.
    I've tried the 5Rs more times than I can count now, I've uninstalled and reinstalled iTunes and Quicktime multiple times, I've recreated my iTunes library multiple times, I've tried setting Gapless to yes for all songs, I've tried setting Gapless to no for all songs, nothing worked.
    I was beginning to think it was my iPod's hard drive but it's not. I have an older version of iTunes on my laptop (8.0.2.20) so I loaded the same songs that were skipping when sync'd from ver 8.1. They don't skip when sync'd from the older version of iTunes.
    Either something is wrong w/ 8.1.1.10 and my 5g iPod and 2g Nano or something happened during the install and I haven't been able to completely wipe iTunes and Quicktime before reinstalling them.
    ps: I forgot to add that the songs play fine in iTunes and when I play them from the iPod through iTunes.
    Message was edited by: sygram

  • My ipod shuffle only plays the first songs on the list.

    My ipod shuffle only plays the first songs on the list even though it has several more podcasts in it. it only plays a series of podcasts instead of all of them. My older shuffle never had this problem. How can I solve this?

    Your older shuffle, if 1st or 2nd gen, did not have the ability to play from multiple playlist.  It was essentially just ONE playlist that you loaded manually using iTunes.  A very simple device.  With the new shuffle, it works more like the "bigger" iPods and you can load more than one playlist (so it is more complex), but if you select a specific playlist (using VoiceOver), it works like the old shuffle.
    My ipod shuffle only plays the first songs on the list even though it has several more podcasts in it.
    That is probably because you are playing songs from the All Songs list, instead of choosing a specific playlist using VoiceOver.  Podcasts do not play from the All Songs list.
    it only plays a series of podcasts instead of all of them.
    If you use VoiceOver to select a podcast, it only plays episodes from that particular podcast.
    Here's what you can do, to make it work like your old shuffle.  Create a new regular playlist in iTunes, and name it something like "iPod Podcasts" or whatever you want.  Treat that new playlist like your old shuffle.  Manually add the podcast episodes you want on the shuffle, in the order you want to hear them, on that playlist.  NOTE:  You can adjust the playlist order after adding the podcast episodes.
    Select the shuffle in iTunes.  You see a row of "tabs" (buttons) starting with Summary.  Click Podcasts there.  This is the Podcasts tab, where you set up how iTunes syncs podcasts.  Check the box for Sync Podcasts.  Below that, since you have a playlist with the podcasts you want on the shuffle, you only need to go to the list under Include Episodes from Playlists and checkmark that iPod Podcasts playlist.
    When you click Apply, the episodes on that playlist sync to the shuffle.  Going forward, to update the podcasts on the shuffle, update that iPod Podcasts playlist (add and remove episodes) in iTunes.  Then, the next time you connect the shuffle, iTunes automatically updates the shuffle with the same changes.  If the shuffle is already connected, click the Sync button to update.
    When using the shuffle, set the shuffle's power switch to the play-in-order (middle) position.  Podcasts are skipped on playlists, if the power switch is set to shuffle.  Use VoiceOver to switch to that iPod Podcasts playlist.  The podcast episodes should play in playlist order.
    NOTE:  You can load songs in the same way.  Create an "iPod Songs" playlist in iTunes, with the songs you want on the shuffle.  Go to the shuffle's Music tab, and select that playlist.  And audiobooks on the Books tab.  You can load as many playlists as you want.  The big advantage of the new shuffle is that you can have different types of content and keep them organized on separate playlists.
    Here's information about VoiceOver, in case it is not already set up.
    http://support.apple.com/kb/ht4322

  • I bought a new album off of iTunes the wifi wasn't strong so I left my computer on as it was downloading and went to sleep. This morning I went to listen to the songs and some of the songs will only play the first 50 sec or the first minute? How do i fix?

    I bought a new album off of iTunes the wifi wasn't strong so I left my computer on as it was downloading and went to sleep. This morning I went to listen to the songs and some of the songs will only play the first 50 sec or the first minute? How do i fix it or refresh them so i can listen to them fully?
    How do I get the songs to fully play? Or can i refresh the songs and redownload them?

    See Repair security permissions for iTunes for Windows.
    tt2

  • TS1717 I just downloaded a song and it only plays the first 50 seconds and then moves to the next song in the list. How can I get it to play the rest of the song?

    I just downloaded a song and it only plays the first 50 seconds and then moves to the next song in the list. How can I get it to play the rest of the song?

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copy of the track and try redownloading a fresh one. See the following document for instructions:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the item, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.

  • ITunes 10 will only play the first track of a CD, including brand new CDs.

    I reinstalled my operating system and had to reinstall iTunes. Now I have version 10 and after I import a CD it will only play the first track then progressively go track by track skipping through the rest without playing. Does it even whether I try to play from the CD or from the music section I imported it to. Even have 3 brand new CDs that it is doign the same thing to, so I have a hard time believing it is a disc reading issue.

    Microsoft Windows Vista Ultimate Edition Service Pack 1 (Build 6001)
    Dell Inc. Inspiron 531s
    iTunes 10.3.1.55
    QuickTime 7.6.9
    FairPlay 1.11.17
    Apple Application Support 1.5.2
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 3.4.1.2
    Apple Mobile Device Driver 1.57.0.0
    Bonjour 2.0.5.0 (214.3)
    Gracenote SDK 1.8.2.457
    Gracenote MusicID 1.8.2.89
    Gracenote Submit 1.8.2.123
    Gracenote DSP 1.8.2.34
    iTunes Serial Number 00D2AD08030F0338
    Current user is an administrator.
    The current local date and time is 2011-07-10 13:45:32.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is not supported.
    Core Media is supported.
    Video Display Information
    ATI Technologies Inc., Radeon X1300 Series (Microsoft Corporation - WDDM)        
    ATI Technologies Inc., Radeon X1300 Series Sec. (Microsoft Corporation - WDDM)
    **** External Plug-ins Information ****
    No external plug-ins installed.
    iPodService 10.3.1.55 is currently running.
    iTunesHelper 10.3.1.55 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    **** CD/DVD Drive Tests ****
    No drivers in LowerFilters.
    UpperFilters: GEARAspiWDM (2.2.0.1),
    E: HL-DT-ST DVD+-RW GSA-H31N, Rev B109
    Drive is empty.

  • HT3204 i bought and downloaded a song from itunes store and it said it was complete but will only play the first 14 seconds of the song then it cuts off. what should i do to retrieve the rest of the song?

    I bought a song from the itunes store and downloaded it and it said download was complete but when i go to play the song it will only play the first 14seconds of it then it cuts off. what should I do to retrieve the rest of the song?

    If you live in a Region that allows re-downloading Music...
    Delete the Song(s) and re-download...
    See Here  >  Download Past Purchases
    http://support.apple.com/kb/HT2519
    If not... Contact iTunes Customer Service
    Apple  Support  iTunes Store  Contact Us

  • How can I play the whole album, when I double click on the album it only plays the first track?

    How can I play all tracks on an album, when I double click on the album it only plays the first track?

    Make sure all the tracks are check-marked.

  • Since syncing my Ipod classic three days ago, the songs will only play the first three minutes and five seconds. Then it just stops. After a little while, it moves on to the next song.

    I have an old iPod Classic, 5th generation with video 30 GB. I sync via a pc. Since syncing it three days ago, the songs will only play the first three minutes and five seconds. Then it moves on to the next song or if it's the last song, it goes back to the menu. I just synced again and it it still doing it.It also has a small group of dots near the middle of the screen that weren't there before.Has anyone else had this problem or know how to fix it?  Thanks.

    Please disregard this question. I have a better worded version coming up.

  • Playcenter 3.02.70 is lately only playing the first 10 secs of music files ?!

    For some reason, and I am not able to figure out what it is, Playcenter 3.02.70 (windows xp) is only playing the first 0 seconds of every midi/mp3 file!
    This is so weird, I haven't experienced this ever in all the many years I have used my soundblaster soundcard and using (this or other versions of) Playcenter. There is nothing in the settings that relate to this option, nor do I know what may have caused this problem.
    I ran an online virusscanner (Kapersky) for the first time after I noticed this (no viruses, as expected).
    I haven't altered any files in the creative directory, or anywhere else as far as I know. I simply don't know what triggered this highly unusual behaviour.
    Any clues to this mystery?

    Microsoft Windows Vista Ultimate Edition Service Pack 1 (Build 6001)
    Dell Inc. Inspiron 531s
    iTunes 10.3.1.55
    QuickTime 7.6.9
    FairPlay 1.11.17
    Apple Application Support 1.5.2
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 3.4.1.2
    Apple Mobile Device Driver 1.57.0.0
    Bonjour 2.0.5.0 (214.3)
    Gracenote SDK 1.8.2.457
    Gracenote MusicID 1.8.2.89
    Gracenote Submit 1.8.2.123
    Gracenote DSP 1.8.2.34
    iTunes Serial Number 00D2AD08030F0338
    Current user is an administrator.
    The current local date and time is 2011-07-10 13:45:32.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is not supported.
    Core Media is supported.
    Video Display Information
    ATI Technologies Inc., Radeon X1300 Series (Microsoft Corporation - WDDM)        
    ATI Technologies Inc., Radeon X1300 Series Sec. (Microsoft Corporation - WDDM)
    **** External Plug-ins Information ****
    No external plug-ins installed.
    iPodService 10.3.1.55 is currently running.
    iTunesHelper 10.3.1.55 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    **** CD/DVD Drive Tests ****
    No drivers in LowerFilters.
    UpperFilters: GEARAspiWDM (2.2.0.1),
    E: HL-DT-ST DVD+-RW GSA-H31N, Rev B109
    Drive is empty.

  • A song I bought only plays the first few seconds....

    I bought an album & one of the songs only plays the first few seconds, backs up, & repeats that part over & over. I show no available downloads. This is very annoying when trying to enjoy an entire album that I love. Please help.

    Update your iTunes to the latest 10.6.3 and see if it rectifies the issue.

  • Apple TV will only play the first song on an album, why?

    When I press play on an album (music), Apple TV only play the first song, then it stops. Why?? I can understand it when I press play on a spesific song/track, but when I press play on an entire album, I want Apple TV to play the entire album.

    You need to put checkmarks in front of all your music.

  • I shot at a Live performance last weekend by using the 'capture now' button. Now, my FCP is only playing the first 6 frames - how can I access or recover the full hour I shot?

    I shot at a Live performance last weekend by using the 'capture now' button. Now, my FCP is only playing the first 6 frames - how can I access or recover the full hour I shot?

    FCP X?  Then you need to use a different forum...This is the FCP 7 and earlier forum:
    https://discussions.apple.com/community/professional_applications/final_cut_pro_ x
    FCP 7?  Did it look like it captured normally? Everything go smoothly?  Stop normal?  Did an error occur at any point?  Can you open the file in QT?
    In the future...do not rely on ONLY FCP for this task. Get a reputable recorder that can record to ProRes. AJA KiPro, KiPro Mini, Atmos Ninja, Decklink Recorder...lots of options.

  • I uploaded 3 audiobooks from iTunes to my iPhone 5 with the latest ios7 on it. Each of them only plays the first 15 mins of the playback and then silence, the bar shows the book is still playing but no sound, any ideas? Thanks

    I uploaded 3 audiobooks from iTunes to my iPhone 5 with the latest ios7 on it. Each of them only plays the first 15 mins of the playback and then silence, the bar shows the book is still playing but no sound, any ideas? Thanks

    What happens when playing the same books in iTunes. Is there sound after 15 min?
    If also silent in iTunes, check the info tab where you can see the item is an audiobook, etc. Check the volume bar, this normally is on the zero point.
    When an audio book is really low in audio, I tend to move this to the plus side (+1=max), but for some strange reason this bar was at -1 in some books I had and they also seemed to play in absolute silence.

  • Helpppp! my flash array will only play the first frame

    my flash array will only play the first frame
    this is the code
    stop();
    var t:Timer=new Timer(100,0);
    t.addEventListener(TimerEvent.TIMER,preloadF);
    t.start();   
    var rdmFrame:Array = ["15","150","420","589","712","807","1135"];
    stage.addEventListener(MouseEvent.CLICK, fnClick)
    function fnClick(e:MouseEvent):void
    trace(rdmFrame[numberRange(0, rdmFrame.length)]);
    function preloadF(e:TimerEvent)
        if(this.framesLoaded>7)   
            t.stop();       
            t.removeEventListener(TimerEvent.TIMER,preloadF);       
            t=null;        
            this.gotoAndPlay(numberRange(0, rdmFrame.length - 1));    
    function numberRange(minNum:Number, maxNum:Number):Number
            return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);

    Ned Murphy wrote:
    Your timer function is not using the array, it is just using the random number.  Adapt what you have in the fnClick function.
    Hi Ned ,
    I am a little confused , sorry .. i am not sure what you mean...i am very new at AS3 ...
    I dont even need the click function .. another developer recommended it as a way to track the random action..
    stop();
    var t:Timer=new Timer(100,0);
    t.addEventListener(TimerEvent.TIMER,preloadF);
    t.start();   
    var rdmFrame:Array = [15,150,420,589,712,807,1135];
    function preloadF(e:TimerEvent)
        if(this.framesLoaded>7)   
            t.stop();       
            t.removeEventListener(TimerEvent.TIMER,preloadF);       
            t=null;        
            this.gotoAndPlay(numberRange(0, rdmFrame.length - 1));    
    function numberRange(minNum:Number, maxNum:Number):Number
            return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);

Maybe you are looking for

  • Forum Posting Tools Do Not Work

    I'm not sure of where this post really belongs ... just sort of frustrated here, can't get anything uploaded. I've got a question on report builder, need to post two 7KB images up to display what I'm having trouble with. with 1024KB max size and 2 im

  • Labview 7.1 crashes windows XP when using VI's saved with the 'Save for Previous Version' option available in Labview 8

    I am trying to work with a series of vi's developed in Labview 8 in Labview 7.1.  The code was saved with the 'Save for Previous Version' option available in Labview 8.  When trying to use the code in LV7.1 my entire Windows XP system locks up (curso

  • Budget control system and former budgeting

    Dear All, Can anyone tell me the main difference between former budgeting and BCS. Kind Regards, Rajini.

  • Relation between OTA_ACTIVITY Tables

    Hi, Can some one explain the relation between ota_activity_definitions, ota_activity_versions,ota_category_usages,ota_act_cat_inclusions tables as how hey are related to one another. Thanks in advance.

  • Loading FLV in Flash using PHP

    Hello, I am using flash CS3 and am trying to load a flv using PHP. I have a PHP webpage with a SWF in it. In that SWF is a FLVPlayback component. I would like to be able to set the source for the FLV using a php URL e.g. http://www.example.com/index.