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
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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