# Reusing the preloader

**URL:** <https://forum.kirupa.com/t/reusing-the-preloader/235412>\
**Category:** Uncategorized\
**Created:** [August 10, 2007, 7:30pm UTC](https://forum.kirupa.com/t/reusing-the-preloader/235412 "2007-08-10T19:30:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerogun](https://avatars.discourse-cdn.com/v4/letter/z/b3f665/32.png) [@zerogun](https://forum.kirupa.com/u/zerogun)\
**Post date:** [August 10, 2007, 7:30pm UTC](https://forum.kirupa.com/t/reusing-the-preloader/235412/1 "2007-08-10T19:30:01Z")

</div>

Hi guys, it’s me again…

I’m trying to use this preloader

onClipEvent (enterFrame) {  
loading = \_parent.getBytesLoaded();  
total = \_parent.getBytesTotal();  
if (percent == undefined) percent = 0;  
percent -= (percent-((loading/total)_100))_.25;  
per = int(percent);  
percentage = per+"%";  
loadBar.\_width = per\*7.00;  
if (percent\>99) {  
\_parent.gotoAndStop(2);  
}  
}

It successfully does it’s job in Scene 1 of the main timeline. However, when I try to reuse it in Scene 2, it appears as if it’s just reloading the data from Scene 1.

The scenario is in Scene 1, a button jumps to Scene 2, in which case the Scene 2 preloader in frame 1 loads up the data of that scene. But because of the way the code is done, I think the the copied and pasted preloader code is just reading Scene 1 again. Is there a way I can modify the code to reuse the code & preload it’s residing Scene i.e. Scene 3,4,5 etc. ?

Thanks a million guys.
