Embedding Movies with Flash, Part I: Basic Methods: Playing a Flash Movie - Doc JavaScript | WebReference

Embedding Movies with Flash, Part I: Basic Methods: Playing a Flash Movie - Doc JavaScript


Embedding Movies with Flash, Part I: Basic Methods

Playing a Flash Movie

In order to embed a Flash movie in your Web page, follow these two steps:

In order to play a Flash movie in your Web page, you need to follow these two steps:

We already used one of the Flash methods (rewind()) in flashmoviecheck.js. The Flash player does not obey our assignment of AUTOSTART to false and the Flash movie autostarted when embedding. We put the following line in flashmoviecheck.js to prevent the movie from autostarting:

window.document.sonify.Rewind();

We can embed a Flash movie and create a JavaScript Flash object in the same script:

<SCRIPT LANGUAGE="JavaScript">
  Flash_embedSWF("swift3d.swf");
  var mySwf = window.document.sonify;
</SCRIPT>

Here are two links that demonstrate the above methods, Rewind() and Play(). The code is shown below the movie area. Play around with these links and see the impact on the following SWF, courtesy of www.swift3d.com. Notice that the Rewind() method rewinds the video but not the audio track:

Rewind | Play

Here is the code for implementing the above links and Flash movie playing:

<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>
<SCRIPT LANGUAGE="JavaScript">
  Flash_embedSWF("swift3d.swf");
  var mySwf = window.document.sonify;
</SCRIPT>

Next: How to jump to a certain frame

https://www.internet.com


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

URL: https://www.webreference.com/js/column85/3.html