# Don't load until window focus?

**URL:** <https://forum.kirupa.com/t/dont-load-until-window-focus/218228>\
**Category:** flash\
**Created:** [March 6, 2007, 1:03am UTC](https://forum.kirupa.com/t/dont-load-until-window-focus/218228 "2007-03-06T01:03:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sogj](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sogj/32/3189_2.png) [@sogj](https://forum.kirupa.com/u/sogj)\
**Post date:** [March 6, 2007, 1:03am UTC](https://forum.kirupa.com/t/dont-load-until-window-focus/218228/1 "2007-03-06T01:03:02Z")

</div>

I looked up “window focus” in actionscript and couldn’t find anything. Is there anyway that I can set it so that my preloader doesn’t advance to the main movie until the person is actually watching?

My code right now, for the last frame of the preloader, is:

```auto
if (percentLoaded = 100) {
gotoAndPlay (4);
}

```

So basically I want it to say something like

```auto
if ((percentLoaded == 100) && (window.focus == "true")) {
gotoAndPlay (4);
}

```

What’s the actual code for this?

Thanks!  
:pac: sogj
