# Preloader not working with external jpegs

**URL:** https://forum.kirupa.com/t/preloader-not-working-with-external-jpegs/320398
**Category:** flash
**Created:** [March 22, 2011, 3:18pm UTC](https://forum.kirupa.com/t/preloader-not-working-with-external-jpegs/320398 "2011-03-22T15:18:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Toner](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@Toner](https://forum.kirupa.com/u/Toner)
#### Post date: [March 22, 2011, 3:18pm UTC](https://forum.kirupa.com/t/preloader-not-working-with-external-jpegs/320398/1 "2011-03-22T15:18:25Z")

</div>

Hi,

Working in Flash CS5 and using ActionScript 2.0 I’m trying to attach a preloader to a MovieClip which has a loader component inside to load an external jpeg. The MovieClip is inside a another MovieClip. I’ve used the same preloader to load my main website and it works fine. I also want to have a preloader for my main photos as they take about a second to load and during this time there is just a blank space that shows.

Below is the code for the preloader;

stop();  
onEnterFrame = function(){  
var percent\_loaded = \_root.getBytesLoaded()/\_root.getBytesTotal();  
preloader\_mc.value = percent\_loaded;  
if (percent\_loaded == 1){  
delete onEnterFrame;  
play();  
}  
}

I’ve changed the \_root. part to this. as the MovieClip is not on the main timeline. Any idea how to get the preloader working on my photos?

Thanks.
