spacer

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

home / experts / javascript / column83


Embedding Sound with Flash, Part III: Streams

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

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

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: May 7, 2001
Revised: May 7, 2001

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