spacer

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

home / experts / javascript / column82


Embedding Sound with Flash, Part II: Playing Variations

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

Autostarting a Sound Track

The autostart property tells the Flash player to start the sound immediately after embedding it in the page. The sound will start automatically. The following two links point to two pages with similar code. The left page embeds a sound track with autostart=true, while the right page embeds a sound track with autostart=false. Try them out:

autostart=true   autostart=false

Here is the code for the left link:

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

Notice the autostart=true assignment. You assign instance properties before you embed the SWF file by embedSWF(). The right link above is the same as the left link, except that the autostart parameter is equal to false. Notice that the sound autostarts in the left link, but, in order to start the sound on the right link, you need to mouse over the "Play Now" link.

Next: How to access non-API properties

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: April 23, 2001
Revised: April 23, 2001

URL: http://www.webreference.com/js/column82/10.html