# Preloading in main movie

**URL:** https://forum.kirupa.com/t/preloading-in-main-movie/185139
**Category:** Uncategorized
**Created:** [April 11, 2006, 9:07am UTC](https://forum.kirupa.com/t/preloading-in-main-movie/185139 "2006-04-11T09:07:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Vectar](https://avatars.discourse-cdn.com/v4/letter/v/b2d939/32.png) [@Vectar](https://forum.kirupa.com/u/Vectar)
#### Post date: [April 11, 2006, 9:07am UTC](https://forum.kirupa.com/t/preloading-in-main-movie/185139/1 "2006-04-11T09:07:01Z")

</div>

Hey everybody can somebody give me a clue on how to build the following: I will have a main.swf that has 3 buttons in th emain swf is a movieclip that will load in the new movies when clicking on one of the 3 buttons. when i click on one of the buttons the movieclip content will dim to 50% alpha or something like that then the preloader starts preloading in the main swf and when he is finished the new swf appaers. Basically what i need to know is how the preload external swf files from the main swf

---

<div class="post-metadata">

### Author: ![suranija](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@suranija](https://forum.kirupa.com/u/suranija)
#### Post date: [April 11, 2006, 11:30am UTC](https://forum.kirupa.com/t/preloading-in-main-movie/185139/2 "2006-04-11T11:30:39Z")

</div>

I donno whether I understood wat u have put across… But If I am right…  
U can use a preloader in the three different swf’s itself… then load that in to ur main movie on release of a button.

I think this was ur problem…  
If u can better explain wat exactly u r looking for … may be I could put forward my ideas…

:cowboy: Sam

---

<div class="post-metadata">

### Author: ![Vectar](https://avatars.discourse-cdn.com/v4/letter/v/b2d939/32.png) [@Vectar](https://forum.kirupa.com/u/Vectar)
#### Post date: [April 12, 2006, 9:26am UTC](https://forum.kirupa.com/t/preloading-in-main-movie/185139/3 "2006-04-12T09:26:33Z")

</div>

hey Suranija here is a site that works like the way i want it [http://www.sofitella.com/sofitel.htm](http://www.sofitella.com/sofitel.htm)

As you take the swf files out of your temporary internet files you will see that the preloader is in the main swf file.  
when clicking on a button you will still see the previous swf file but then faded out a little.

Hopefully you will understand what i mean.

---

<div class="post-metadata">

### Author: ![aneeeeshv](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@aneeeeshv](https://forum.kirupa.com/u/aneeeeshv)
#### Post date: [April 13, 2006, 10:48am UTC](https://forum.kirupa.com/t/preloading-in-main-movie/185139/4 "2006-04-13T10:48:26Z")

</div>

The method i use creating a empty movie clips and loading each movies

Heres the script

//-------------------------------------------------- [GLOBAL PRELOADER] ----------------------------------------------------------//  
var empty = this.createEmptyMovieClip(“cup”, “100”);  
empty.\_x = 0;  
empty.\_y = 177.0;  
my\_mc\_load = new MovieClipLoader();  
preload = new Object();  
my\_mc\_load.addListener(preload);  
preload.onLoadStart = function(targetMC) {  
trace("started loading "+targetMC);  
cup.\_alpha = 0;  
bar.endR = 100;  
pText.\_visible = true;  
};  
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {  
bar.\_width = (lBytes/tBytes)\*899;  
pText.text = “% “+Math.round((lBytes/tBytes)\*100);  
};  
preload.onLoadComplete = function(targetMC) {  
[//cup.fadeIn](https://cup.fadeIn)();  
cup.\_alpha = 100;  
cup.play();  
bar.endR = 0;  
pText.\_visible = false;  
trace(targetMC+” finished”);  
trace(“section\_on”+section\_on);  
if (section\_ID == “intro\_sequeance”) {  
intro\_sequeance();  
}  
if (section\_ID == “home\_sequeance”) {  
home\_sequeance();  
}  
};

if you load any movie to dynamically generated mc “cup” preloader will activate and will play the mc after preloading. Here “bar” is my preloader instance name

Hope this helps…

yo

---

<div class="post-metadata">

### Author: ![Vectar](https://avatars.discourse-cdn.com/v4/letter/v/b2d939/32.png) [@Vectar](https://forum.kirupa.com/u/Vectar)
#### Post date: [April 13, 2006, 4:58pm UTC](https://forum.kirupa.com/t/preloading-in-main-movie/185139/5 "2006-04-13T16:58:39Z")

</div>

hey many thanks for the script.  
I maybe asking alot but would you have a sample file for me so i can study it because my actionscript knowledge is not that big.

thanks
