# Preloader script from tutorials

**URL:** <https://forum.kirupa.com/t/preloader-script-from-tutorials/64227>\
**Category:** Uncategorized\
**Created:** [September 14, 2004, 11:35am UTC](https://forum.kirupa.com/t/preloader-script-from-tutorials/64227 "2004-09-14T11:35:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zed](https://avatars.discourse-cdn.com/v4/letter/z/d78d45/32.png) [@zed](https://forum.kirupa.com/u/zed)\
**Post date:** [September 14, 2004, 11:35am UTC](https://forum.kirupa.com/t/preloader-script-from-tutorials/64227/1 "2004-09-14T11:35:35Z")

</div>

I’ve been using this simple script from the kirupa tutorials section to preload my movies:

```auto
if (_framesloaded>=_totalframes) {
gotoAndPlay (2);
} else {
gotoAndPlay (1);
}

```

Is this the best code to use, because all I want is to show a small animation that loops to tell the viewer that the movie is loading. I only ask, because I have embedded some video in a few files but this script only works half it should do & then tries to load the video, but then stops about five frames after until it has ‘properly’ loaded. It is quite frustrating to say the least…

Is this code actionscript 2 or 1? should it be exported with a specific Flash player? I think at the moment it’s Flash Player 7. And in actionscript 2 I have the export frame for classes set as frame 2, is this correct?

I know I’m being useless but I hope you understand and can help a guy out.

Cheers

---

<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:** [September 14, 2004, 11:06pm UTC](https://forum.kirupa.com/t/preloader-script-from-tutorials/64227/2 "2004-09-14T23:06:16Z")

</div>

i have always used getBytesTotal(); and getBytesLoaded();

whether or not that is a better way than yours is something i cant say.
