The AF FS Command JavaScript Library Movie Reference Information This is a continuation of the Movie Reference Information page and requires that you have read and understood that page. Working with frames When working with frames, you must use the setFrameRef function to create the movie reference(s). If the movie is in a named DIV or LAYER tag, you must use setLayerFrameRef function. The name of the frame that is required by these functions is set in the
FRAME tag NAME attribute. Each frame document that has a movie that sends out FS Commands must at least be created using the standard FS Command template included in Flash. One of the frames will have to hold the entire script for all of the other frames and movies to use. It is possible to have the full script in more than one frame, but the movie references created in one frame will not be directly available to the function calls in the other frames. In most circumstances, it is best to host the script in one frame and to direct all function calls to the script in that frame. The method for doing this depends on whether you are using FS Commands or JavaScript (in HTML or via the Flash Get URL). For FS Command calls to that script frame, you will need to add the
following line to the area within the
movieName_DoFSCommand function reserved for placing your
script actions:
windowRef must be either top or parent. windowRef refers to the document window that spawned the frameset (the page that contains the FRAMESET tags). Unless you have nested frames, top and parent are the same and refer to the uppermost document window. Nested frames are when a document in a frame also has a FRAMESET. When called from a frame created by the nested frameset, top still refers to the uppermost document window, but parent now refers only to the frame that spawned the nested frame. frameName must be replaced with the actual name of the frame that holds the script. The frameName must be enclosed in single quotes. Making this change to the generated page, will redirect all calls from FS Command to the frame with the JavaScript library. If you have the script only in one frame and need to make calls to the script directly in JavaScript or by using JavaScript in the Get URL action in Flash, you will just need to add the same format of a window and frame reference before the function call as was shown in the FS Command example above. Get URL ("top.frames['myFrame'].playMovie(2)") The tricky part Here is an example of using libLoad to create movie references in a
frame that does not house the script library: Parents Only These functions also do not allow you to create a reference to a nested frame from a frame that is outside of the nested frameset. All this simply means is that the use of nested frames will require some additional scripting. The exact nature of this additional scripting is beyond the scope of this informational document. For more information, you should look at a JavaScript reference on working with frames. Setting Movie References in Multiple Windows 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. |
Copyright©2000, AshzFall. All Rights Reserved. |