# Preloader needed for jpg

**URL:** <https://forum.kirupa.com/t/preloader-needed-for-jpg/26911>\
**Category:** Uncategorized\
**Created:** [July 28, 2003, 6:24am UTC](https://forum.kirupa.com/t/preloader-needed-for-jpg/26911 "2003-07-28T06:24:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![julia](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@julia](https://forum.kirupa.com/u/julia)\
**Post date:** [July 28, 2003, 6:24am UTC](https://forum.kirupa.com/t/preloader-needed-for-jpg/26911/1 "2003-07-28T06:24:55Z")

</div>

hello!

i’m posting my fla in case a Flash Guardian Angel wishes to help me.  
i just need a preloader for my dynamically loading jpgs.

fyi, i don’t need buttons or anything for this…it’s a very simple slideshow where the images come in every 100 frames…that’s it.

does anyone know what code i should put it so that my images will preload at the beginning so the slideshow doesn’t stutter?

thank you!!

julia

---

<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 28, 2003, 6:34am UTC](https://forum.kirupa.com/t/preloader-needed-for-jpg/26911/2 "2003-07-28T06:34:17Z")

</div>

[AS]var first = 1;//first pic  
var last = 5;//last pic  
var whichPic = 1;  
var depth = 100;  
MovieClip.prototype.preload = function(picture) {  
this.createEmptyMovieClip(“holder”, depth);  
holder.loadMovie(picture);  
this.onEnterFrame = function() {  
var bytesLoaded = holder.getBytesLoaded();  
var bytesTotal = holder.getBytesTotal();  
var percent = Math.round(bytesLoaded/bytesTotal)\*100;  
myText.text = percent+" %";  
if (bytesLoaded\>0 && bytesLoaded\>=bytesTotal) {  
content\_mc.loadMovie(picture);  
myText.text = picture;  
delete this.onEnterFrame;  
}  
};  
};  
back = function() {  
whichPic–;  
if (whichPic\>=first) {  
preload(whichPic+".jpg");  
} else {  
whichPic = first;  
}  
};  
next = function() {  
whichPic++;  
if (whichPic\<=last) {  
preload(whichPic+".jpg");  
} else {  
whichPic = last;  
}  
};  
backbutton.onPress = function() {  
back();  
};  
nextbutton.onPress = function() {  
next();  
};  
this.createEmptyMovieClip(“content\_mc”, depth++);  
preload(“1.jpg”);//set initial picture to be displayed[/AS]All your images should be in the format “1.jpg”,“2.jpg”,“3.jpg”, and so on… (no quotes)

Just create a textfield with an instance name of “myText” (no quotes) and 2 buttons (“backbutton” and “nextbutton”)

---

<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 28, 2003, 6:47am UTC](https://forum.kirupa.com/t/preloader-needed-for-jpg/26911/3 "2003-07-28T06:47:13Z")

</div>

hi claudio,

thanks so much! this is a bit over my head - would it be ok to PM you?

julia

---

<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 28, 2003, 6:52am UTC](https://forum.kirupa.com/t/preloader-needed-for-jpg/26911/4 "2003-07-28T06:52:09Z")

</div>

Ok.

---

<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 28, 2003, 7:41am UTC](https://forum.kirupa.com/t/preloader-needed-for-jpg/26911/5 "2003-07-28T07:41:22Z")

</div>

if anyone else can help point me to an easy tutorial, it would be much appreciated. thank you. 🙂

---

<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 28, 2003, 8:54am UTC](https://forum.kirupa.com/t/preloader-needed-for-jpg/26911/6 "2003-07-28T08:54:27Z")

</div>

im not sooo sure about this one… but if you go to [www.flashkit.com](http://www.flashkit.com) they have some alright tutorials
