# Preloading a shared library

**URL:** <https://forum.kirupa.com/t/preloading-a-shared-library/191227>\
**Category:** flash\
**Created:** [June 18, 2006, 10:20pm UTC](https://forum.kirupa.com/t/preloading-a-shared-library/191227 "2006-06-18T22:20:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattMDesign](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@MattMDesign](https://forum.kirupa.com/u/MattMDesign)\
**Post date:** [June 18, 2006, 10:20pm UTC](https://forum.kirupa.com/t/preloading-a-shared-library/191227/1 "2006-06-18T22:20:46Z")

</div>

Hi,  
I have a library called shared.swf, and in my movie called home.swf I display a lot of assets that are in the shared.swf library. To preload home.swf I use this code in the first frame:

```auto

bytes_loaded = Math.round(getBytesLoaded());
bytes_total = Math.round(getBytesTotal());
getPercent = bytes_loaded/bytes_total;
loadBar._width = getPercent*80;
if (bytes_loaded == bytes_total) {
 gotoAndPlay(3);
}

```

and in the 2nd frame I have:

```auto

gotoAndPlay(1);

```

But it is only preloading the assets that are actually in the home.swf file and not the ones that are in the shared.swf library. This causes transitions using the shared.swf assets to be very laggy. Is there a way to modify the preloading code that I posted above to also preload the shared.swf library, or even better, just the assets from shared.swf that are used in home.swf?  
Thanks, Matt
