# Preloading and Loading levels into flash Question?

**URL:** <https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928>\
**Category:** flash\
**Created:** [December 1, 2002, 7:23am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928 "2002-12-01T07:23:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bodom78](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@Bodom78](https://forum.kirupa.com/u/Bodom78)\
**Post date:** [December 1, 2002, 7:23am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928/1 "2002-12-01T07:23:46Z")

</div>

using this code :

```php
on (rollOver) {
    loadMovieNum("homefire.swf", 1);
}

```

Will the animation be included in the total once I create a pre loader for the main stage? Why I ask is, I wan’t these animations to be ready once the page has loaded up, rather then flash loading them when the rollover has taken place, thus having a pause untill the download is complete.

---

<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:** [December 1, 2002, 7:26am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928/2 "2002-12-01T07:26:31Z")

</div>

So you want to add the preload size of the animation movie loaded into level1 and level0 together as one preloader. Or do you want a preloader in each seperate movie?

---

<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:** [December 1, 2002, 7:30am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928/3 "2002-12-01T07:30:44Z")

</div>

he’s asking if the loaded movie is part of the main movie and if the main preloader will preload all both at once!  
never thought of that… :-  
I think the main preloader will preload the main movie and then the loaded movie appears and it starts downloading and preloading the loaded one! :-\ might be wrong ofcors!

---

<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:** [December 1, 2002, 7:45am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928/4 "2002-12-01T07:45:40Z")

</div>

> \*Originally posted by dan4885 \*  
> \*\*So you want to add the preload size of the animation movie loaded into level1 and level0 together as one preloader. Or do you want a preloader in each seperate movie? \*\*

Yes, I wan’t the preloader to actually load Level 0, 1 and so on as some animations will be necessary rather quickly, and a pause while it downloading level 1 would ruin the effect.

I assume that standard pre loaders only load level 0, leaving the other levels to be loaded only when they are called for. I really need some of these levels to be ready once level 0 is ready.

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:** [December 1, 2002, 7:47am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928/5 "2002-12-01T07:47:10Z")

</div>

```php
//Frame 1
loadMovieNum("yourmovie.swf", 1);

//Frame 2
kbytes_total = (_level0.getBytesTotal() / 1024) + (_level1.getBytesTotal() / 1024);
kbytes_loaded = (_level0.getBytesLoaded() / 1024) + (_level1.getBytesLoaded() / 1024);
if(kbytes_loaded >= kbytes_total) {
	_root.gotoAndStop(4)
}

//Frame 3
gotoAndPlay(2);

//Frame 4
//Start of your movie

```

---

<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:** [December 1, 2002, 7:50am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928/6 "2002-12-01T07:50:30Z")

</div>

Excellent, thankyou for the code :D, I assume that I can continue to add which levels I require, any restriction in doing so (I only have a very basic Actionscript understanding).

---

<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:** [December 1, 2002, 7:55am UTC](https://forum.kirupa.com/t/preloading-and-loading-levels-into-flash-question/8928/7 "2002-12-01T07:55:05Z")

</div>

so… that code is gonna preload all the movies loaded in frame #1 at once?  
[EDIT]OF course it will… wasn’t thinking clearly 😏[/EDIT]
