# If bytes loaded

**URL:** <https://forum.kirupa.com/t/if-bytes-loaded/29120>\
**Category:** Uncategorized\
**Created:** [August 22, 2003, 2:53pm UTC](https://forum.kirupa.com/t/if-bytes-loaded/29120 "2003-08-22T14:53:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipegm](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@felipegm](https://forum.kirupa.com/u/felipegm)\
**Post date:** [August 22, 2003, 2:53pm UTC](https://forum.kirupa.com/t/if-bytes-loaded/29120/1 "2003-08-22T14:53:23Z")

</div>

I´m doind I small slideshow.  
The pictures will be loaded apart, and will have a preloader.  
I want to make the slideshow to play only after all the movieclip (pictures) are fully loaded on to the main movie.

How do I do that?

thanks

---

<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:** [August 22, 2003, 3:11pm UTC](https://forum.kirupa.com/t/if-bytes-loaded/29120/2 "2003-08-22T15:11:07Z")

</div>

Something like this might work:  
[AS]var clips = [clip1, clip2, …, clipN];  
this.createEmptyMovieClip(“preloader”, 9876);  
preloader.onEnterFrame = function() {  
for (var i=0; i\<clips.length; i++) {  
var bloaded = clips[\*\*\*\*i].getBytesLoaded();  
var btotal = clips[\*\*\*\*i].getBytesTotal();  
if (bloaded\>0 && bloaded == btotal) {  
clips.splice(i, 1);  
}  
}  
if (!clips.length) {  
// start slideshow here  
this.removeMovieClip();  
}  
};[/AS]  
Just put the instance names of your MovieClips in the _clips_ Array. 😛
