May 1, 2001 - Conditional Flash Playing
May 1, 2001|
Conditional Flash Playing
Tips: May 2001
Yehuda Shiran, Ph.D.
IsPlaying()method checks if the playhead is moving. You can use this method to create innovative sound combinations. For example, you can play a sound track only if the other sound track is mute.
As a reminder, in order to sonify your page, follow this recipe:
flashsound.js in the
HEAD section. Download.
onmouseover event handler to the
The left three out of the following four links mimic a typical tape recorder control panel. The right link checks if the playhead is moving along the timeline. Mouse over it and find out the answer to the question "IsPlaying?". The link at the second line plays a scale passage, but only if the tutorial is not playing. We do this conditional playing by checking that the tutorial's
false. The tutorial's object is
mySoundObj1, and the scale passage's object is
mySoundObj2. The conditional playing is:
Play around with the links. Start the tutorial. Try to play the scale and see that it does not play. Pause the tutorial. Try now to play the scale. See that it does play now. Continue the tutorial. Can you play the scale now?
if (!mySoundObj1.IsPlaying()) mySoundObj2.TGotoAndPlay('/scale-event', 'start')
Play A Scale
Here is the source code:
Notice we assign autostart to
Here are links you can use to download