A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Getting names of external .swfs

  1. #1
    The Dr. Funky Love
    Join Date
    Apr 2001
    Location
    Salt Lake City
    Posts
    25

    Thumbs down

    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!

  2. #2
    Senior Member
    Join Date
    May 2001
    Location
    Peoria, Arizona
    Posts
    1,889
    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.

  3. #3
    The Dr. Funky Love
    Join Date
    Apr 2001
    Location
    Salt Lake City
    Posts
    25

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center