spacer
Yehuda Shiran April 25, 2001
Hiding the FlashSound Object
Tips: April 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
The FlashSound JavaScript API embeds a FlashSound object in the page with the embedSWF() method. But where is this object in the page? How come we don't see it? FlashSound hides the object. In Internet Explorer it makes it transparent. In Netscape Navigator (v4.x) it assigns its color to be the exact same color of the page. You can change the color of the object in Netscape Navigator, by setting the bgcolor property.

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

  • Make sure you have the Flash player. 96% of the surfing population already has it. Download.
  • Include 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 scale passage when moused over in Internet Explorer 4+ or Netscape Navigator 4.x. Try it:

Play a Scale

(a colored dot should appear in the beginning of this line in Netscape Navigator)

We created the FlashSound object as follows:

<SCRIPT>
  mySoundObj.bgcolor = "#0000ff";
  mySoundObj.embedSWF("scale.swf");
</SCRIPT>

Look carefully now in Netscape Navigator and notice a small dot below the "Play a Scale" link above. You notice it because its color is no longer equal to the page's background color.

Here is the source code:

<HTML>
<HEAD>
  <SCRIPT SRC="flashsound.js"></SCRIPT>
  <SCRIPT>
    var mySoundObj = new FlashSound();
  </SCRIPT>
</HEAD>
<BODY>
<P><A HREF="javascript://" 
  onmouseover="mySoundObj.TGotoAndPlay('/scale-event', 'start')">
  Play a Scale</A>
<SCRIPT>
  mySoundObj.bgcolor = "#0000ff";
  mySoundObj.embedSWF("scale.swf");
</SCRIPT>
</BODY>
</HTML>

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

Download flashsound.js

Download scale.swf


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags