April 26, 2001 - Flash Streaming | WebReference

April 26, 2001 - Flash Streaming

Yehuda Shiran April 26, 2001
Flash Streaming
Tips: April 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Flash file format supports four different types of sync: event, start, stop, and stream. An event sync allows you to play multiple tracks at the same time. A start sync avoids parallel tracks. A stop sync stops tracks. A stream sync sound consists of frame-sized chunks of sound that play back to back seamlessly. Unlike true streaming audio formats like Real Audio, a Flash stream file loads into the browser as it plays. At the end of the playback, the stream sound is fully loaded in the browser cache. A subsequent playback comes from the browser cache rather than loading from the Web (as is the case with Real Audio).

As a reminder, in order to sonify your page, follow this recipe:

flashsound.js in the HEAD section. Download.
  • Create a flashsound object in the
  • HEAD section.
  • Embed your SWF file in the
  • BODY section.
  • Create an anchor tag and set the
  • onmouseover event handler to the TGotoAndPlay() method.

    The following link plays a stream sync that explains the FlashSound JavaScript API. Click it:

    Play the Tutorial

    Here is the source code:

    <HTML>
    <HEAD>
      <SCRIPT SRC="flashsound.js"></SCRIPT>
      <SCRIPT>
        var mySoundObj = new FlashSound();
      </SCRIPT>
    </HEAD>
    <BODY>
    <SCRIPT>
      mySoundObj.embedSWF("earsonly.swf");
    </SCRIPT>
    </BODY>
    </HTML>

    Notice that the Flash sound was set in the Flash editor to autostart.

    Here are links you can use to download flashsound.js and earsonly.swf:

    Download flashsound.js

    Download earsonly.swf