spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column85


Embedding Movies with Flash, Part I: Basic Methods

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Replacing and Superimposing a Movie

Use the Flash method 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 0 to ensure that any old SWFs are deleted before the new SWF is loaded. Set layerNumber to 1 to superimpose the new SWF on top of the previous SWF.

On this page we preload swift3d.swf. You can see its traces in the window below. When you click the Replace Movie link, another SWF, opener.swf (courtesy of www.associatesinscience.com), will be loaded instead of the previous SWF. When you click the Superimpose Movie link, opener.swf will be superimposed on top of swift3d.swf. Use the following links to play, rewind, and load opener.swf:

Rewind | Play | Replace Movie | Superimpose 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(0, 'opener.swf'); return false">
  Replace Movie</A> |
<A href="javascript://" onclick="javascript:mySwf.
  LoadMovie(1, 'opener.swf'); return false">
  Superimpose Movie</A>
<SCRIPT LANGUAGE="JavaScript">
  Flash_embedSWF("swift3d.swf");
  var mySwf = window.document.sonify;
</SCRIPT>

Next: How to zoom a movie

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: June 4, 2001
Revised: June 4, 2001

URL: http://www.webreference.com/js/column85/6.html