hi guys, i have a movie clip name 'gall', this movie clip is used to load images off from a web directory 'images', i have 2 movieclips which for navigation (previous and next), the problem i'm facing now is that i'm not sure how i should actually load the images from this web directory and use the 2 movieclilps for navigation to navigate thru this web directory of images.. help anyone? thanks
if you know the names of the images list them in an array and script your next and previous buttons control the array's index: imageA=[your images listed here]; ind=-1; nextBtn.onPress=function(){ ind++; // you might reset ind when it equals imageA.length targetMC.loadMovie(imageA[ind]); } prevBtn.onPress=function(){ ind--; //you might reset if less than zero. targetMC.loadMovie(imageA[ind]); }
.... you can name your pictures 1.jpg, 2.jpg, 3.jpg ... and add code below to first frame of your movie. You must have tvo movies named 'left' and 'right' as the movie clip for where you will load pics named 'movie'... or you can rename variables in script. In code is string with value 'numOfLastImage+1' you replace this with last number of your image+1as the line of code below but withouth 1... The pictures need to be placed in same directory as the movie. If they ar not in same directory, you need to specify a path to that directory in 'movie.loadMovie()' example movie.loadMovie( "pics/"+i+".jpg") .Just replace 'pics' with your path I hope this will help //Script for slide show i = 0; right.onRelease = function(){ i++; if(i == numOfLastImage+1){ i = numOfLastImage;} movie.loadMovie(i+".jpg");} left.onRelease = function(){ i--; if(i == 0){ i = 1;} movie.loadMovie(i+".jpg");}
i tried it and it doesn't work, here's my code: i = 0; nxt.onRelease = function(){ i++; if(i == numOfLastImage+1){ i = 1;} gall.loadMovie( "works/"+i+".jpg"); } prev.onRelease = function(){ i--; if(i == 0){ i = numOfLastImage;} gall.loadMovie("works/"+i+".jpg"); }
You have to remake it in Photoshop or some other program to that size (easyest way) or to make scrip to resize pics to that size, what is not so easy for newby, because of inheritance scalled movie in what you load pics.
You have to replace code to this //Script for slide show i = 0; right.onRelease = function(){ i++; if(i == numOfLastImage+1){ i = 1;} movie.loadMovie(i+".jpg");} left.onRelease = function(){ i--; if(i == 0){ i = numOfLastImage;} movie.loadMovie(i+".jpg");} compare this scrip with script posted before and you see a difference.
.... logically it won't work, because you dont replace 'numOfLastImage' with number of your last image. Code below works with 4 pictures. If you have more or less pics, than you replace number 4 with number of your last image. Srory ... my mistake I did not tell you that you have to replace that in code. i = 0; nxt.onRelease = function(){ i++; if(i == 4+1){ i = 1;} gall.loadMovie("works/"+i+".jpg"); } prev.onRelease = function(){ i--; if(i == 0){ i = 4;} gall.loadMovie("works/"+i+".jpg"); }
nah it's fine, not your fault, i just misinterpreted it... anyways, is there a way that i last image to be the first? and when i click nxt.button it goes descending like 101,100,99,98.... etc.?
set first 'i' to 100, and change third line of code to 'i--'; it will descend.
Don't see what you're looking for? Try a search.
|