# Problem with preloader for dynamically loaded jpegs

**URL:** https://forum.kirupa.com/t/problem-with-preloader-for-dynamically-loaded-jpegs/94497
**Category:** Uncategorized
**Created:** [November 13, 2003, 7:48am UTC](https://forum.kirupa.com/t/problem-with-preloader-for-dynamically-loaded-jpegs/94497 "2003-11-13T07:48:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rave\_t](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@rave\_t](https://forum.kirupa.com/u/rave_t)
#### Post date: [November 13, 2003, 7:48am UTC](https://forum.kirupa.com/t/problem-with-preloader-for-dynamically-loaded-jpegs/94497/1 "2003-11-13T07:48:48Z")

</div>

I use this code to display the progress of the jpeg im loading dynamically into my empty movieclip, bildholder.

bytes\_loaded = Math.round(bildholder.getBytesLoaded());  
bytes\_total = Math.round(bildholder.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
loadpic = “\_loading\_product “+Math.round(getPercent\*100)+” % loaded”;  
if (bytes\_loaded \>= bytes\_total) {  
gotoAndPlay(“done”);  
}

The problem is that I cant get the line:  
bytes\_total = Math.round(bildholder.getBytesTotal());

to work. It seems that Flash have a problem getting the TotalBytes for a dynamically jpeg.

When i set bytes\_loaded to a fix number, say 5000, then the preloader works but not wgen I use the command .getBytesTotal()

Can anyone tell me why or how I can solve this problem.

---

<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: [November 15, 2003, 7:51pm UTC](https://forum.kirupa.com/t/problem-with-preloader-for-dynamically-loaded-jpegs/94497/2 "2003-11-15T19:51:29Z")

</div>

any one please 🅱
