# Preloading external movies

**URL:** <https://forum.kirupa.com/t/preloading-external-movies/23718>\
**Category:** Uncategorized\
**Created:** [June 21, 2003, 12:52pm UTC](https://forum.kirupa.com/t/preloading-external-movies/23718 "2003-06-21T12:52:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pspecial](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pspecial](https://forum.kirupa.com/u/pspecial)\
**Post date:** [June 21, 2003, 12:52pm UTC](https://forum.kirupa.com/t/preloading-external-movies/23718/1 "2003-06-21T12:52:35Z")

</div>

Does anyone know how to create a preloader for an externally loaded .swf movie?

I used Flix to created a .swf movie from a video. I’m loading it to my main timeline using loadMovie. How would I create a preloader to let the user know the file is loading?

---

<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:** [June 21, 2003, 12:53pm UTC](https://forum.kirupa.com/t/preloading-external-movies/23718/2 "2003-06-21T12:53:31Z")

</div>

Search the tutoial list on Kirupa.  
🙂

---

<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:** [June 21, 2003, 1:09pm UTC](https://forum.kirupa.com/t/preloading-external-movies/23718/3 "2003-06-21T13:09:36Z")

</div>

Well, you could make advantage of the fact that when movies are loaded inside other ones, they share the same root. This is just something I’m thinking about, I don’t know if it works.

1. Use the [kirupa.com](http://kirupa.com) tutorial to create the preloader in the external movie ([here](http://www.kirupa.com/developer/mx/percentagepreloader.htm)), cut (CTRL+X) everything underneath [COLOR=BLUE]getPercent = bytes\_loaded/bytes\_total;[/COLOR]

2. Replace [COLOR=BLUE]bytes\_loaded[/COLOR] and [COLOR=BLUE]bytes\_total[/COLOR] with [COLOR=BLUE]\_root.bytes\_loaded[/COLOR] and [COLOR=BLUE]\_root.bytes\_total[/COLOR] and at [COLOR=BLUE]\_root.[/COLOR] before getPercent.

3. Now apply the same preloader to your main movie, but delete (not cut) everything above getPercent … including getPercent, so that you have this code:

[AS]  
\_root.loadBar.\_width = \_root.getPercent_100;  
\_root.loadText = Math.round(\_root.getPercent_100)+"%";  
if (\_root.bytes\_loaded == \_root.bytes\_total) {  
\_root.gotoAndPlay(3);  
}  
[/AS]

I already changed everything necesary in the above code. It might work, but like I said before, it’s an experiment.

---

<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:** [June 21, 2003, 1:36pm UTC](https://forum.kirupa.com/t/preloading-external-movies/23718/4 "2003-06-21T13:36:42Z")

</div>

This is exactly what I´ve been struggling with for a couple of days now. Got some advice from lostinbeta in this thread [http://www.kirupaforum.com/forums/showthread.php?s=&threadid=26291](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=26291)  
but it didn´t work for me ´couse I wanted to load movies into an MC that I´ve already placed in an specific location in my main movie and that example createde an empty MC for the movie and an MC for the preloader and then they pulled info from eachother. I´m not at my workstation som I can´t check out the code you gave Voetsjoeba but I will follow this thread carefully! 🙂

---

<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:** [June 24, 2003, 12:57am UTC](https://forum.kirupa.com/t/preloading-external-movies/23718/5 "2003-06-24T00:57:22Z")

</div>

Yo, any luck finding a solution?

I cant seem to get my mind around this one.

The pieces are there, but I dont know how to arrange them.

Does the preloader code go on the main timeline or in the holder MC? And where do you put your loadMovie() method??? I know I shouldnt put it as a callback, but how can I possibly put it before the if/then statement. That bypasses the whole preloader!

Any help would be greatly appreciated.

---

<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:** [June 24, 2003, 1:59pm UTC](https://forum.kirupa.com/t/preloading-external-movies/23718/6 "2003-06-24T13:59:58Z")

</div>

I´m still working on it can´t get it to work properly either.

But as far as the preloader code that has to go in your main timeline and the loadMovie() comand have to be in the same frame or before the preloader code as well as where your textboxes and loadBar are located (I guess?).
