View Single Post
  #6 (permalink)  
Old Dec 3rd, 2005, 17:26
timmytots timmytots is offline
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 308
Thanks: 1
Thanked 0 Times in 0 Posts
Re: Very strange problem indeed!

Well here it is then. But as I say there doesn't seem to be any possible reason it would have anything to do with the code. I thought it must be more to do with the system cache or something or the way I've done the images but no.
Code: Select all
stop();


numberOfImages = 9; // total number of images required


num=0;


imgDelay = 5; //no of seconds to wait


alphaSpeed = 4; // speed that images fade in


var waitCount = 0;


imageDirectory = "pics/talent/li/";





this.createEmptyMovieClip("imgHolder",1); //  creates a blank mc


imgHolder._x = 21; // change the x position to where you want on the stage


imgHolder._y = 17; // ditto the y position


function loadImage(){


        num++;
        


        if(num>numberOfImages){


                num = 1;


        }
    
//change number of image text
        
imagenum.text = num + "/" + numberOfImages;        
        



        imgHolder._alpha = 0;


        imgHolder.loadMovie(imageDirectory + "pic" + 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();

Last edited by sypher; Dec 5th, 2005 at 03:20.
Reply With Quote