# Want preloader to play once - help!

**URL:** <https://forum.kirupa.com/t/want-preloader-to-play-once-help/264429>\
**Category:** Uncategorized\
**Created:** [June 26, 2008, 2:32am UTC](https://forum.kirupa.com/t/want-preloader-to-play-once-help/264429 "2008-06-26T02:32:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LadySamG](https://avatars.discourse-cdn.com/v4/letter/l/eb8c5e/32.png) [@LadySamG](https://forum.kirupa.com/u/LadySamG)\
**Post date:** [June 26, 2008, 2:32am UTC](https://forum.kirupa.com/t/want-preloader-to-play-once-help/264429/1 "2008-06-26T02:32:04Z")

</div>

Hi,

I hope someone can help me. I’ve designed a website that has three gallery sections; P, F, and C. Each section was done in a native fla file with pictures embedded in it and a preloader in the first few frames. I want the preloader to show once the first time the user clicks on a gallery section, so I’ve used a global variable in the top movie which is initially set to 0.

My method works perfectly when I test it out in flash, but when I upload the site and test it online, the preloader plays every time I press the section, **even though the global variable has changed!** (I know this because I had it displayed in text).

Here is my code (pretty simple);

if (\_global.once\_playedF == 0) {  
gotoAndPlay(2);  
} else {  
gotoAndPlay(“sld1”);  
}

\_global.onceplayedP is set to one in the second frame.

Can anyone tell me where I’m going wrong?
