The AF FS Command JavaScript Library Movie Reference Information

All movie references created with the movie reference functions of the library are stored in an array of movie references.

In JavaScript, an array looks like this:
myArray[0],myArray[1],myArray[2]...and so on.
The numbers in the array example are called index numbers.

No matter which call you make to create a reference, you must specify the index number that will distinguish one member of the array from any of the others. If you use a movie reference number to create a movie reference via one of the movie reference creation functions and later reuse the same movie reference number in the same or a different movie creation function, you will lose any reference to the original movie referenced by the movie reference number.

It is best to make all of the movie reference setting calls that you will require in either via the onLoad event of the HTML BODY tag or in an early frame action(s) of your Flash movie(s). This way, if the user refreshes the page or returns to it using the browser navigation buttons, the movie references will be reset.

By default, the onLoad event in the template files creates the movie with the reference number of 0 to be equal to the movie that was published with the template.

If you do not need to interact with movies other than the movie that was published with the library template, you do not need to make any changes or additions.

If you need to make references to additional movies in the same document, you should create a new function in JavaScript to handle the onLoad event. This new function should hold all the the movie reference function calls.
An example function:
function myLoader()
{
setMovieRef('myMovie1',0);
setMovieRef('myMovie2',1);
setMovieRef('myMovie3',2);
setMovieRef('myMovie4',3);
setMovieRef('myMovie5',4);
}
This example sets references to movies named myMovie1 to myMovie5 in the same document. In the BODY tag for the document, add or replace the onLoad call with:
onLoad="myLoader()"

To perform a function on a movie, you must send the movie reference number to the function as an argument. Using the previous example, to perform a function on myMovie3, we would send 2 in the position in the arguments list for the function where the movie reference number must be provided.
playMovie(2) would play the movie named myMovie3.

If the movie(s) on the same page are in named DIV or LAYER tags, you will need to use the setLayerRef call instead of setMovieRef.

If you need to create references to movies in other frames or windows, that is a bit more complex. For more information, please see the following documents:
Setting Movie References in Multiple Frames
Setting Movie References in Multiple Windows

If you need to set references for movies that are in in a frameset in another window, read the documentation for both windows and frames and then use either the setWindowFrameRef or the setLayerWindowFrameRef function to set the reference.

To get a quick view of some of the things that are possible with this library, see the examples.

To get the library, see the download area.


Examples Download Reference

Copyright©2000, AshzFall. All Rights Reserved.
Macromedia and Flash are trademarks of Macromedia, Inc.