# Swf play one time

**URL:** <https://forum.kirupa.com/t/swf-play-one-time/18504>\
**Category:** Uncategorized\
**Created:** [April 17, 2003, 10:07am UTC](https://forum.kirupa.com/t/swf-play-one-time/18504 "2003-04-17T10:07:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![leenx](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@leenx](https://forum.kirupa.com/u/leenx)\
**Post date:** [April 17, 2003, 10:07am UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/1 "2003-04-17T10:07:31Z")

</div>

Hi

I have a website with a small “swf animation” thing in it,  
it is in the same frame where everytime the visitor clicks the frame will reload because an other picture has to be displayed.

But now also the flash movie starts again, is there a way to let the flash movie just play once for every session someone vistits the website?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 10:16am UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/2 "2003-04-17T10:16:07Z")

</div>

I’m not sure how to do it… but there is a way.

Try searching using the keyword “local objects Flash MX”

both on this site and on the macromedia site itself. If you get no result… let me know and I’ll see what I can find. Local objects are like cookies and can be used to store information on a users machine.  
If you can figure out how to set them you simply need to set a variable that lets your Flash player know that they have been there before and then skips the animation if it finds that variable to be true.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 12:04pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/3 "2003-04-17T12:04:53Z")

</div>

hey thanx… i’m checking it out… must be something like this

myLocalSharedObject = sharedobject.getLocal(“myCookie”);

if (myLocalSharedObject == null){  
\_root.gotoAndPlay(“start”);  
}

else {  
\_root.gotoAndStop(“done”);  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 2:10pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/4 "2003-04-17T14:10:36Z")

</div>

um…if you did that it would play once during a persons lifetime, not per time they see the movie…you’d have to set the value of the sharedObject to null again after someone quits the website

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 2:19pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/5 "2003-04-17T14:19:14Z")

</div>

hehe you’re right

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 2:21pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/6 "2003-04-17T14:21:30Z")

</div>

YAY…an idea for that though is make some button on your site…that everyone will have to click…and when they click it the thing is reset to null…but after they click the button they will never go to the movie page again…that shouldn’t be to hard?!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 2:23pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/7 "2003-04-17T14:23:12Z")

</div>

hmm

i’m still not sure how to fix this one

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 2:26pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/8 "2003-04-17T14:26:04Z")

</div>

umm…after the movie finishes playing…will the visitor ever go to the page with the movie again?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 2:30pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/9 "2003-04-17T14:30:28Z")

</div>

yes… in fact… everytime, because in de same “title frame” there is also a photo that has to refresh everytime the visitor clicks to another subject of the site

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 17, 2003, 2:37pm UTC](https://forum.kirupa.com/t/swf-play-one-time/18504/10 "2003-04-17T14:37:10Z")

</div>

well then i’m stupted…this is a toughie
