# Adding a preloader to an already existing Flash movie

**URL:** <https://forum.kirupa.com/t/adding-a-preloader-to-an-already-existing-flash-movie/57061>\
**Category:** flash\
**Created:** [July 9, 2004, 9:37pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-an-already-existing-flash-movie/57061 "2004-07-09T21:37:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hal](https://avatars.discourse-cdn.com/v4/letter/h/ee7513/32.png) [@Hal](https://forum.kirupa.com/u/Hal)\
**Post date:** [July 9, 2004, 9:37pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-an-already-existing-flash-movie/57061/1 "2004-07-09T21:37:45Z")

</div>

I created a Flash movie that takes some time to upload (even with DSL) and wanted to add a preloader to it. Can this be done after the fact? If so, how? I’ve read: [http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm) and understand how to create the preloader, just not sure how to connect it to my already existing Flash movie. And would anything need to change in the action script?

Hal

---

<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:** [July 9, 2004, 10:04pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-an-already-existing-flash-movie/57061/2 "2004-07-09T22:04:05Z")

</div>

> [@Hal](#):
>
> I created a Flash movie that takes some time to upload (even with DSL) and wanted to add a preloader to it. Can this be done after the fact? If so, how? I’ve read: [kirupa.com - Percentage Preloader with Load Bar](http://www.kirupa.com/developer/mx/percentagepreloader.htm) and understand how to create the preloader, just not sure how to connect it to my already existing Flash movie. And would anything need to change in the action script?
> 
> Hal

yes it can, you just have to move all the frames on the main timeline up 2 frames. If you have references in your script such as “goToAndPlay(12)” etc, you will have to change these but hopefully you have used frame labels.

---

<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:** [July 9, 2004, 10:20pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-an-already-existing-flash-movie/57061/3 "2004-07-09T22:20:12Z")

</div>

Should the preload I build then go above or below the movie info? And does the action script for the preload need to change. It is currently:

bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loadBar.\_width = getPercent_100;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

---

<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:** [July 9, 2004, 10:43pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-an-already-existing-flash-movie/57061/4 "2004-07-09T22:43:59Z")

</div>

> [@Hal](#):
>
> Should the preload I build then go above or below the movie info? And does the action script for the preload need to change. It is currently:
> 
> bytes\_loaded = Math.round(this.getBytesLoaded());  
> bytes\_total = Math.round(this.getBytesTotal());  
> getPercent = bytes\_loaded/bytes\_total;  
> this.loadBar.\_width = getPercent_100;  
> this.loadText = Math.round(getPercent_100)+“%”;  
> if (bytes\_loaded == bytes\_total) {  
> this.gotoAndPlay(3);  
> }

I`ve made you a basic preloader, the code is not the same as kirupas but it works pretty much the same but is a bit more flexible. when testing, you need to go to simulate download/view streaming to see and set at a low KB/s.  
it assumes the main movie is on frame 2 but you can change to 3 if you want.  
[http://www.gifsrus.com/testfile/basicpreloader.fla](http://www.gifsrus.com/testfile/basicpreloader.fla)

---

<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:** [July 9, 2004, 11:22pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-an-already-existing-flash-movie/57061/5 "2004-07-09T23:22:44Z")

</div>

Got it! Thanks!
