spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column83


Embedding Sound with Flash, Part III: Streams

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Hiding Embedded SWFs

The FlashSound JavaScript API embeds a FlashSound object in the page, together 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 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.

The following link plays a scale passage when moused over. 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>

Now look carefully 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>

Next: How to play a stream sync SWF

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: May 7, 2001
Revised: May 7, 2001

URL: http://www.webreference.com/js/column83/2.html