June 4, 2001 - Superimposing Movies
June 4, 2001 Superimposing Movies Tips: June 2001
Yehuda Shiran, Ph.D.
|
One of the "tiny" details is embedding the Flash object. The JavaScript file flashmoviecheck.js
does exactly this, as well as other stuff. For example, it checks whether a Flash player exists (Flash plug-in or ActiveX control), and whether its version is higher than the minimum required by the application.
LoadMovie()
to load a SWF file. The syntax is:
LoadMovie(layerNumber, URL)
This method loads a given SWF (2nd argument) into the SWF object that the method belongs to. The parameter layerNumber
designates the position of the new SWF with respect to other SWFs in the same page area. Set layerNumber
to one to superimpose the new SWF on top of the previous SWF.
In this tip we preload swift3d.swf
. You can see its traces in the window below. When you click the Load Movie
link, another SWF, opener.swf
(courtesy of www.associatesinscience.com
), will be loaded on top of the previous SWF. Use the following links to play, rewind, and load opener.swf
:
Rewind | Play | Load Movie
Here is the code:
<SCRIPT LANGUAGE="JavaScript" SRC="flashmoviecheck.js"></SCRIPT>
<A href="javascript://" onclick="javascript:mySwf.Rewind(); return false">Rewind</A> |
<A href="javascript://" onclick="javascript:mySwf.Play(); return false">Play</A> |
<A href="javascript://" onclick="javascript:mySwf.LoadMovie(1, 'opener.swf'); return false">Load Movie</A>
<SCRIPT LANGUAGE="JavaScript">
Flash_embedSWF("swift3d.swf");
var mySwf = window.document.sonify;
</SCRIPT>