# I know i've posted a lot of questions, but here is yet another one about loading jpeg

**URL:** <https://forum.kirupa.com/t/i-know-ive-posted-a-lot-of-questions-but-here-is-yet-another-one-about-loading-jpeg/24969>\
**Category:** Uncategorized\
**Created:** [July 7, 2003, 8:05pm UTC](https://forum.kirupa.com/t/i-know-ive-posted-a-lot-of-questions-but-here-is-yet-another-one-about-loading-jpeg/24969 "2003-07-07T20:05:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![OhSuzie](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@OhSuzie](https://forum.kirupa.com/u/OhSuzie)\
**Post date:** [July 7, 2003, 8:05pm UTC](https://forum.kirupa.com/t/i-know-ive-posted-a-lot-of-questions-but-here-is-yet-another-one-about-loading-jpeg/24969/1 "2003-07-07T20:05:06Z")

</div>

Ok, I am trying to do the photo gallery tutorial by Kirupa, I think the code is by Suprabeener. I want to dynamically load photos with Flash 5, but every time I test the movie, it says Error finding URL: C://Windows/My Documents/pic.jpg for every pic that is on my harddrive. What is the problem here?? I have tried importing the photos into the library, which defeats the purpose of trying to minimize memory, but the paths to the pics don’t seem to work, even though it is correct to the dot. Kirupa uses a movieclip.prototype function which I don’t know works in Flash 5. Anybody have any clues on loading jpeg’s dynamically, and furthermore, positioning them on the stage? Is it necessary for me to create an empty movie clip, and if so, can I still load jpeg’s dynamically??

Suzie:stunned:

---

<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:** [July 7, 2003, 8:30pm UTC](https://forum.kirupa.com/t/i-know-ive-posted-a-lot-of-questions-but-here-is-yet-another-one-about-loading-jpeg/24969/2 "2003-07-07T20:30:24Z")

</div>

keep all the images in the same folder as swf.the problem is that u dont have any images located C://Windows/My Documents/pic.jpg

---

<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:** [July 7, 2003, 8:37pm UTC](https://forum.kirupa.com/t/i-know-ive-posted-a-lot-of-questions-but-here-is-yet-another-one-about-loading-jpeg/24969/3 "2003-07-07T20:37:19Z")

</div>

I do. THe photo’s are on Netscape but I copied them into the same folder as my swf.

---

<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:** [July 7, 2003, 8:38pm UTC](https://forum.kirupa.com/t/i-know-ive-posted-a-lot-of-questions-but-here-is-yet-another-one-about-loading-jpeg/24969/4 "2003-07-07T20:38:36Z")

</div>

what code are u using to load them?

---

<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:** [July 8, 2003, 7:40pm UTC](https://forum.kirupa.com/t/i-know-ive-posted-a-lot-of-questions-but-here-is-yet-another-one-about-loading-jpeg/24969/5 "2003-07-08T19:40:38Z")

</div>

Below is kirupa’s photo gallery code. I could use something simpler–basically i want to loop through an array of photos in a somewhat nice way. I could use a component, but there are none I can find for flash 5/ Any suggestions?  
this.pathToPics = “/”;

this.pArray = [“one.jpg”, “two.jpg”];  
this.fadeSpeed = 20;  
this.pIndex = 0;  
// MovieClip methods ----------------------------------  
// d=direction; should 1 or -1 but can be any number  
//loads an image automatically when you run animation  
loadMovie(this.pathToPics+this.pArray[0], \_root.photo);  
MovieClip.prototype.changePhoto = function(d) {  
// make sure pIndex falls within pArray.length  
this.pIndex = (this.pIndex+d)%this.pArray.length;  
if (this.pIndex\<0) {  
this.pIndex += this.pArray.length;  
}  
this.onEnterFrame = fadeOut;  
};  
MovieClip.prototype.fadeOut = function() {  
if (this.photo.\_alpha\>this.fadeSpeed) {  
this.photo.\_alpha -= this.fadeSpeed;  
} else {  
this.loadPhoto();  
}  
};  
MovieClip.prototype.loadPhoto = function() {  
// specify the movieclip to load images into  
var p = \_root.photo;  
//------------------------------------------  
p.\_alpha = 0;  
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);  
this.onEnterFrame = loadMeter;  
};  
MovieClip.prototype.loadMeter = function() {  
var i, l, t;  
l = this.photo.getBytesLoaded();  
t = this.photo.getBytesTotal();  
if (t\>0 && t == l) {  
this.onEnterFrame = fadeIn;  
} else {  
trace(l/t);

that bit of Pindex modulo code and array length really confuses me.

Suzie
