# Image Directory Help!

**URL:** https://forum.kirupa.com/t/image-directory-help/153700
**Category:** Uncategorized
**Created:** [July 4, 2005, 1:43am UTC](https://forum.kirupa.com/t/image-directory-help/153700 "2005-07-04T01:43:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![edv1972](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@edv1972](https://forum.kirupa.com/u/edv1972)
#### Post date: [July 4, 2005, 1:43am UTC](https://forum.kirupa.com/t/image-directory-help/153700/1 "2005-07-04T01:43:46Z")

</div>

Ok, what am I doing wrong??

could someone take a look at this code?

numberOfImages = 4;  
// total number of images required  
num = 0;  
imgDelay = 3;  
// no of seconds to wait  
alphaSpeed = 4;  
// speed that images fade in  
var waitCount = 0;  
imageDirectory = TransitionPics; //[color=red] right here, when I test my movie, it tells me there is an error opening the file and I am going nuts trying to figure out how to load my folder properly… how do I do it?? help please!! I am about to pull my hair out… “TransitionPics” is the name of my folder where my pics are stored and I can’t seem to have the path right, any easy way to fix that? or where should I put the folder at?[/color]  
this.createEmptyMovieClip(“imgHolder”, 1);  
// creates a blank mc  
imgHolder.\_x = 0;  
// change the x position to where you want on the stage  
imgHolder.\_y = 0;  
// ditto the y position  
function loadImage() {  
num++;  
if (num\>numberOfImages) {  
num = 1;  
}  
imgHolder.\_alpha = 0;  
imgHolder.loadMovie(imageDirectory+num+".jpg");  
checkInt = setInterval(checkImgLoaded, 500);  
}  
function checkImgLoaded() {  
imgBytesLoaded = imgHolder.getBytesLoaded();  
imgTotalBytes = imgHolder.getBytesTotal();  
if (imgBytesLoaded == imgTotalBytes) {  
clearInterval(checkInt);  
fadeInt = setInterval(fadeIn, 100);  
}  
}  
function fadeIn() {  
imgHolder.\_alpha += alphaSpeed;  
if (imgHolder.\_alpha\>99) {  
imgHolder.\_alpha = 100;  
clearInterval(fadeInt);  
waitCount = 0;  
waitInt = setInterval(imgWait, 1000);  
}  
}  
function imgWait() {  
waitCount++;  
if (waitCount == imgDelay) {  
clearInterval(waitInt);  
fadeInt = setInterval(fadeOut, 100);  
}  
}  
function fadeOut() {  
imgHolder.\_alpha -= alphaSpeed;  
if (imgHolder.\_alpha\<=alphaSpeed) {  
clearInterval(fadeInt);  
loadImage();  
}  
}  
loadImage();  
stop();
