# Preloading loadMovie(JPEG-file)

**URL:** <https://forum.kirupa.com/t/preloading-loadmovie-jpeg-file/17890>\
**Category:** Uncategorized\
**Created:** [April 10, 2003, 1:18pm UTC](https://forum.kirupa.com/t/preloading-loadmovie-jpeg-file/17890 "2003-04-10T13:18:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oscar\_alexander](https://avatars.discourse-cdn.com/v4/letter/o/e5b9ba/32.png) [@oscar\_alexander](https://forum.kirupa.com/u/oscar_alexander)\
**Post date:** [April 10, 2003, 1:18pm UTC](https://forum.kirupa.com/t/preloading-loadmovie-jpeg-file/17890/1 "2003-04-10T13:18:18Z")

</div>

I’m loading a JPEG file with the loadMovie() method, is there any way to preload this, or to view the loading progress?

[SIZE=1](note: I quickly browsed through some of the preloading topics here, but none answered this issue.)[/SIZE]

---

<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:** [April 10, 2003, 3:29pm UTC](https://forum.kirupa.com/t/preloading-loadmovie-jpeg-file/17890/2 "2003-04-10T15:29:28Z")

</div>

untested, but you might try this:

on the button:

```auto

on(release){
  _root.container.loadMovie("myPicture.jpg");
  t = _root.container.getBytesTotal();
  l = _root.container.getBytesLoaded();
  percent = (l/t)*100;
  if (t>0 && percent<100) _root.container.percentage = percent;
}

```

and put an mc with an instance name of _container_ on your main timeline. In this container mc, create a dynamic textfield with a variable name of _percentage_

Cheers.

Ik hoop dat het werkt… 😉

---

<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:** [April 10, 2003, 3:38pm UTC](https://forum.kirupa.com/t/preloading-loadmovie-jpeg-file/17890/3 "2003-04-10T15:38:16Z")

</div>

that won’t work. it will load the picture, but you need a loop to check for the bytesLoaded and bytesTotal

---

<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:** [April 10, 2003, 5:42pm UTC](https://forum.kirupa.com/t/preloading-loadmovie-jpeg-file/17890/4 "2003-04-10T17:42:24Z")

</div>

- feeling very stupid now \*

I was wondering myself how I would be able to test a preloader like this. 'cause in Flash when I do ‘Show Streaming’ it won’t show the preloader for a loadMovie, would it?

Anyway, how about this?

On the main timeline:

```auto

this.onEnterFrame = function(){
  t = _root.container.getBytesTotal();
  l = _root.container.getBytesLoaded();
  percent = (l/t)*100;
  if (t>0 && percent<100) _root.container.percentage = percent;
}

```

and on the load-button:

```auto

on(release){
  _root.container.loadMovie("1.jpg");
}

```
