# Loading diffrent movies at once

**URL:** <https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294>\
**Category:** Uncategorized\
**Created:** [November 12, 2003, 12:31pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294 "2003-11-12T12:31:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiina](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@Tiina](https://forum.kirupa.com/u/Tiina)\
**Post date:** [November 12, 2003, 12:31pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/1 "2003-11-12T12:31:40Z")

</div>

I am trying to load diffrent movies at one time. I have written in one movie clip this;

> onClipEvent (load) { loadMovieNum(“home.swf”, 1); } onClipEvent (load) { loadMovieNum(“about.swf”, 1); } onClipEvent (load) { loadMovieNum(“services.swf”, 1); } onClipEvent (load) { loadMovieNum(“portfolio.swf”, 1); } onClipEvent (load) { loadMovieNum(“contact.swf”, 1); }

What am i doing wrong?And if i am loading wrong how should i load, when the preloader has finished playing 5 movies, with out clicking any button, like the in the file.

It loads only one movie, but not the rest.:pa:

---

<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:** [November 12, 2003, 12:41pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/2 "2003-11-12T12:41:07Z")

</div>

> onClipEvent (load) { loadMovieNum(“home.swf”, 1); } onClipEvent (load) { loadMovieNum(“about.swf”, 1); } onClipEvent (load) { loadMovieNum(“services.swf”, 1); } onClipEvent (load) { loadMovieNum(“portfolio.swf”, 1); } onClipEvent (load) { loadMovieNum(“contact.swf”, 1); }

i think you have to put something like[AS]  
onClipEvent (load) {loadMovieNum(“yourfile1.swf”, 1);  
loadMovieNum(“yourfile2”, 1);  
loadMovieNum(“yourfile3.swf”, 1);  
}  
[/AS]

---

<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:** [November 12, 2003, 12:45pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/3 "2003-11-12T12:45:01Z")

</div>

loadMovieNum(“home.swf”, 1);

You’re loading all of your movies into the same \_level (you’ve specified \_level1 as the second parameter of your loadMovieNum() method) so they’re displacing one another.

You need to specify different levels for each movie e.g.

loadMovieNum(“home.swf”, 1);  
loadMovieNum(“about.swf”, 2);

and so on …

The syntax to reference your movie is

\_level1.getBytesLoaded()  
\_level1.play();

Bear in mind that if you attempt to load all the movies simultaneously you will share the bandwidth between them.

---

<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:** [November 12, 2003, 12:53pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/4 "2003-11-12T12:53:48Z")

</div>

It worked thx! what do you mean with.

> Bear in mind that if you attempt to load all the movies simultaneously you will share the bandwidth between them.

all the movies have their own preloders, they are all 5 buttons very small buttons, but because they are animated in a very difficult way i need to load them piece by piece that way it wont make the main movie too big…:beam:

---

<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:** [November 12, 2003, 1:34pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/5 "2003-11-12T13:34:26Z")

</div>

The principal reason for breaking a site into several swfs which are loaded as required is that users on a slow connection aren’t forced to wait until elements they may not need (or want) have downloaded before they can interact with the site. If the first action of your \_level0 swf is to simultaneously attempt to load all other elements of the site at the same time - then all clips to be loaded will guzzle up all of the available bandwidth and behave as if they were elements of a single preloading movie.

A better approach might be to load movies as required with an additional background process that downloads external swfs to the browser cache when there is no other traffic.

---

<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:** [November 12, 2003, 1:40pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/6 "2003-11-12T13:40:15Z")

</div>

That sounds good, you think you could provide me with a link, so i could try it out please:sure:

---

<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:** [November 12, 2003, 5:59pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/7 "2003-11-12T17:59:18Z")

</div>

Can’t think of a link offhand - someone else might be able to suggest one.

The basic elements you need are

loadMovie()  
getBytesLoaded()  
getBytesTotal()  
setInterval()  
clearInterval()  
\_global.movieLoading=true/false  
\_global.clipsToLoad=new Array(“home.swf”,“about.swf”,“products.swf”)

The work flow is as follows

Set a background process to execute every n seconds using setInterval(). If a movie is being loaded then wait for it to finish. If no movie is being loaded, choose the next not yet loaded clip from the list and download it to a movie instance positioned off screen. It will then download to the cache.

If a player clicks a link, interrupt the download by loading the swf they have chose in to the off-screen instance. This will break any download in progress so you’re not sharing bandwidth between two swfs. When the chosen download has been completed then you can resume the background download where you left off.

---

<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:** [November 12, 2003, 6:03pm UTC](https://forum.kirupa.com/t/loading-diffrent-movies-at-once/35294/8 "2003-11-12T18:03:41Z")

</div>

Thx!I am loading into an empty Mc now, looks better:s:
