April 3, 2001 - The FlashSound JavaScript API | WebReference

April 3, 2001 - The FlashSound JavaScript API

Yehuda Shiran April 3, 2001
The FlashSound JavaScript API
Tips: April 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

You can control the Flash player with JavaScript. The Sonify organization promotes standards in using interactive audio for the web, wireless, and consoles. They developed the FlashSound JavaScript API. This API (Application Procedural Interface) enables you to add simple interactive sound to your conventional HTML page, without relying upon any graphic presentation. The FlashSound JavaScript API (FJA) is an excellent way to ramp up on how to control Flash with Javascript. When you add sound to your page, you actually sonify your page.

The FJA is implemented in flashsound.js. Right-click this link and save the script to your hard drive. In any usage of FJA, you need to source this JavaScript file in the HEAD section of your page:

<HEAD>
  <SCRIPT SRC="flashsound.js"></SCRIPT>
</HEAD>

You also need to create a new sound object that will provide you with all FJA's properties and methods. The constructor function is called FlashSound(). Here is the modified HEAD section:

<HEAD>
  <SCRIPT SRC="flashsound.js"></SCRIPT>
  <SCRIPT>
    var mySoundObj = new FlashSound();
  </SCRIPT>
</HEAD>