# I need help! creating image direct

**URL:** https://forum.kirupa.com/t/i-need-help-creating-image-direct/153698
**Category:** flash
**Created:** [July 4, 2005, 1:10am UTC](https://forum.kirupa.com/t/i-need-help-creating-image-direct/153698 "2005-07-04T01:10:59Z")
**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:10am UTC](https://forum.kirupa.com/t/i-need-help-creating-image-direct/153698/1 "2005-07-04T01:10:59Z")

</div>

Ok, I need your help badly.

I have a bunch of pictures I want to load dynamically into my movie and I have the code but I don’t know how to create my image directory. If I have my pictures in my c: drive and I want to load them into my empty movie, how do I do that?

this is my folder:

c:/my\_documents/…/transitionpics

and this is my code:

numberOfImages = 5; // 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 = “images/”; // [color=red]this is where I need help with, how do I [/color]  
[color=red][/color]  
[color=red]create this and then load it into my empty movie  
[/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&gt;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&gt;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&lt;= alphaSpeed){

	clearInterval(fadeInt);

	loadImage();

}

```

}

loadImage();

stop();
