# Loading external jpgs

**URL:** <https://forum.kirupa.com/t/loading-external-jpgs/311778>\
**Category:** Uncategorized\
**Created:** [July 16, 2010, 7:47am UTC](https://forum.kirupa.com/t/loading-external-jpgs/311778 "2010-07-16T07:47:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robvr6](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@robvr6](https://forum.kirupa.com/u/robvr6)\
**Post date:** [July 16, 2010, 7:47am UTC](https://forum.kirupa.com/t/loading-external-jpgs/311778/1 "2010-07-16T07:47:33Z")

</div>

Hi All,

I hope someone can help me out with this I am using a simple gallery to load external jpegs and everything works but I am trying to get the first one to load when it starts but with no success. I have added my as code which loads the images so hopefully one of the experts out there may be able to point me in the right direction.

```auto
 
imgbtn1.onRollOver = function() {
 infoField._visible = true;
 startLoading("1.jpg");
};
imgbtn2.onRollOver = function() {
 infoField._visible = true;
 startLoading("2.jpg");
};
imgbtn3.onRollOver = function() {
 infoField._visible = true;
 startLoading("3.jpg");
};
imgbtn4.onRollOver = function() {
 infoField._visible = true;
 startLoading("4.jpg");
};
imgbtn5.onRollOver = function() {
 infoField._visible = true;
 startLoading("5.jpg");
};
imgbtn6.onRollOver = function() {
 infoField._visible = true;
 startLoading("6.jpg");
};
imgbtn7.onRollOver = function() {
 infoField._visible = true;
 startLoading("7.jpg");
};
imgbtn8.onRollOver = function() {
 infoField._visible = true;
 startLoading("8.jpg");
};
imgbtn9.onRollOver = function() {
 infoField._visible = true;
 startLoading("9.jpg");
};
imgbtn10.onRollOver = function() {
 infoField._visible = true;
 startLoading("10.jpg");
};
 
function startLoading(whichImage) {
 loadMovie(whichImage, "imageLoader");
 _root.onEnterFrame = function() {
  infoLoaded = imageLoader.getBytesLoaded();
  infoTotal = imageLoader.getBytesTotal();
  percentage = Math.floor(infoLoaded/infoTotal*100);
  infoField.text = percentage+"%";
  if (percentage>=100) {
   delete this.onEnterFrame;
   infoField._visible = false;
  }
 };
}

```
