★ wanayoo — archive 1999 http://javaboutique.internet.com/AudioBox/Nouvelle recherche | Portail wanayoo
internet.com logo To JavaBoutique Home

 Java News
 Latest Applets
 Applet Categories
 Applet Index
 Applet Help
 Submit Applets
 Other Resources
 How-To Java
 Java Reviews
 Java FAQs
 Java Forum
 Java IDEs
To Webdeveloper.com
 Mecklermedia
 Internet.com
 Magazines
 Trade Shows
 Advertise
 Corporate
 Information
 Search
 Subscribe

webreference.com

Search Engine Watch

The JavaScript Source

AudioBox


Press a button to play a sound. Sounds will composite when overlapped. Important: when running within Navigator on a local computer, it may be necassary to wait one or two minutes until the status bar indicates that the java applet is running before pressing the form buttons.

This applet is a slick example of using JavaScript to communicate with an applet. It's fast, easy to use, and still allows the user to control the experience.


Usage: Download the zip file containing the class file and an example page, along with two example audio clips. Unzip it into one directory, and follow the instructions on the example page.

Java Source: Not available.

HTML Source:

<applet code="AudioBox.class" name="AudioBox" width=5 height=5>
</applet>

<form> <input type="button" value="Sonar" onClick="playAudioClip('sonar.au')"> <input type="button" value="Babam" onClick="playAudioClip('babam.au')"> </form>

JavaScript Source:

<script language="javascript1.1">
<!--
//This function tells the AudioBox applet to play a sound
function playAudioClip( sAudioURL )
{
	if ( (navigator.javaEnabled != null) && 
	     (navigator.javaEnabled()) )
                document.AudioBox.playSoundtrack( sAudioURL );
}
//-->
</script>

Author: 1Automata




Copyright 1998 Mecklermedia Corporation.
All Rights Reserved. Legal Notices.