| home / tutorials
/ FS Command JavaScript Library / movie reference
information Tutorial details: Written by: AshzFall / http://www.ashzfall.com/ Difficulty Level: Intermediate Requirements: Flash 5 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: 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. 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. 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: 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. |
||