-
Greets, fellow flashers...
The question:
Is it possible to get the file name of the .swf that is playing on a certain level and load it into a variable?
The situation:
What I'm working on here is a "controller" .swf file that will sit on level 1 and control a series of .swfs that play on level 0... let's call them movie1.swf through movie10.swf.
What I'd like to do is enter the file names of the movies into an array in the controller file (ex: myMovies[0]="movie1.swf"; myMovies[1]="movie2.swf";), then when the user clicks a "next movie" button, the the controller gets the name of the file playing on level0, checks the array for the file order, and then plays the next file on the list.
I understand that there are much easier methods of accomplishing this same effect, but without writing 50 pages of details, let's just say that if at all possible, this is the way I have to do it.
Thanks in advance! :) :) :)
-
Make the array value in [0] as a variable such as [x], and then you can query the var to which movie should load next.
-
Hmmm...
Maybe I'm not sure what you mean...
So I should set the array indices to variables? Maybe I didn't explain the problem very well.
Here's an example of what I've got:
Code:
movFiles = new Array();
movFiles[0] = "movie1.swf";
movFiles[1] = "movie2.swf";
movFiles[2] = "movie3.swf";
movFiles[3] = "movie4.swf";
movFiles[4] = "movie5.swf";
function goNext() {
for (count=0; i<movFiles.length; count++) {
if (currentMovie == movFiles[count]) {
loadMovieNum(movFiles[count+1],0);
}
}
}
This code is inside a .swf file that is on level 1, and contains a "next" button that calls the "goNext" function.
The movies "movie1.swf", etc. above play on level 0.
What I want to know is if there is a way for the movie on level 1 to get the physical file name (i.e. return a string "movie1.swf" into the variable currentMovie) of the movie on level 0 so it can evaluate which file to play next.
Like I said, trust me, if possible it just has to be done this way.
Thanks!