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>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();