OK, im trying to break sbeener’s AS code down to the bare minimum and learn what code is needed to load dynamic files using an array. Im not concerned with the fading effect or what not at this point just trying to understand how the array and load procedures work.
Do you need anything else besides the code listed below to create an array using dynamic files?
this.pathToPics = “pics/”;
The array
this.pArray = [“01.jpg”, “02.jpg”, “03.jpg”, “etc…”]
POM, or anyone else, can you take a look at the code below and help me figure out why the previous button AS is not working? Everything else works ok. I didnt write this code from scratch and still very much a AS newbie. Thanks for the help!!
//ARRAY
swflist = new Array(“1.jpg”,“2.jpg”,“3.jpg”,“4.jpg”,“5.jpg”);
swflist.position = 0;
//SETTING FIRST PICTURE TO LOAD AUTOMATICALLY
loadMovieNum(“1.jpg”, 1);
// NEXT BUTTON
on (release) {
swflist.position = (swflist.position == swflist.length-1) ? 0 : swflist.position+1;
loadMovieNum(swflist[swflist.position], 1);
}
Is it only possible to load jpg files this way? I tried with gif, but nothing showed… With jpg it works just fine
anyone knows why this is? I followed the tut on this site…
Oh sorry I forgot I removed it. Well guess what. I went to put it back and now its working. I don’t think I did anything different this time – maybe I shouldn’t have been working on it so late last night :). I uploaded the finished copy if anyone would like to take a look at it.
tsavo, as far as loading gif files I havent tried it yet but I dont see why it wouldnt work. This script was originally designed to dynamically load mp3 files.
Ok, Im back with some more questions. I setup the previous/next buttons so the user can click button or use arrow keys. Is there a way to make the arrow keys active without having to click first. The arrow work but you have to click on the movie before they work. Code listed below:
// AS for Next Button
on (release) {
swflist.position = (swflist.position == swflist.length-1) ? 0 : swflist.position+1;
loadMovieNum(swflist[swflist.position], 1);
}