spacer

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

home / experts / javascript / column83


Embedding Sound with Flash, Part III: Streams

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Setting the Minimum Supported Version

Sometimes, writing a version-independent script gives too much overhead. Instead, you may elect to support only versions higher than a minimum version number. Usually, 80% of your surfers have the most updated player version. So, why bother with older versions? You set the minimum supported version by the setMinPlayer() method. The single argument is the version number.

Let's verify that indeed setMinPlayer() is doing the job. Since the highest player version number is 5, we would mute the player when we put 6 as the minimum version number. The following three lines of links demonstrate this fact. Set the minimum player version to 5 and get the bottom two lines of links to function as expected. Set the minimum player version to 6 and make the player mute.

Set Minimum Player to 5  Set Minimum Player to 6

Rewind and Play the Tutorial  Pause  Continue  Is Playing?

Play A Scale

Here is the source code:

<HTML>
<HEAD>
<SCRIPT SRC="flashsound.js"></SCRIPT>
<SCRIPT>
  var mySoundObj1 = new FlashSound();
  var mySoundObj2 = new FlashSound();
</SCRIPT>
</HEAD>
<BODY>
<P><A HREF="javascript://"
  onmouseover="FlashSound.setMinPlayer(5);
  alert('Minimum Player Version Set to 5')">
  Set Minimum Player to 5</A>
  <A HREF="javascript://"
  onmouseover="FlashSound.setMinPlayer(6);
  alert('Minimum Player Version Set to 6')">
  Set Minimum Player to 6</A></P>
  <A HREF="javascript://"
  onmouseover="mySoundObj1.TGotoAndPlay('/',1)">
    Rewind and Play the Tutorial</A>
  <A HREF="javascript://"
  onmouseover="mySoundObj1.TStopPlay('/')">Pause</A>
  <A HREF="javascript://"
  onmouseover="mySoundObj1.TPlay('/')">Continue</A>
  <A HREF="javascript://"
  onmouseover="alert(mySoundObj1.IsPlaying('/'))">
    Is Playing?</A></P>
  <A HREF="javascript://"
  onmouseover="if (!mySoundObj1.IsPlaying())
    mySoundObj2.TGotoAndPlay('/scale-event', 'start')">
    Play A Scale</A></P>
<SCRIPT>
  mySoundObj1.autostart = false;
  mySoundObj1.embedSWF("earsonly.swf");
  mySoundObj2.embedSWF("scale.swf");
</SCRIPT>
</BODY>
</HTML>

Next: How to suppress error messages

http://www.internet.com


The Network for Technology Professionals

Search:

About Internet.com

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

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
UC Gaining a Foothold in Government · Workers Say Telework Is More Productive, Bosses Not So Sure · Kingston Debuts Power-Saving Memory Upgrades


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

URL: http://www.webreference.com/js/column83/11.html