May 6, 2001 - Version-Limited Flash Scripting
May 6, 2001 Version-Limited Flash Scripting Tips: May 2001
Yehuda Shiran, Ph.D.
|
setMinPlayer()
method. The single argument is the version number.
As a reminder, in order to sonify your page, follow this recipe:
flashsound.js
in the HEAD
section. Download.
HEAD
section.
BODY
section.
onmouseover
event handler to the TGotoAndPlay()
method.
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 link 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 ScaleHere 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>
Notice we assign autostart
to false
. The reason is that the stream example here was set to autostart upon embedding. We can override the Flash behavior with JavaScript commands.
Here are links you can use to download flashsound.js
, earsonly.swf
, and scale.swf
: