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
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Playing Multiple Instances

When you edit a Flash file, you can choose how the sound track synchronizes with other instances of the same sound track. You can opt, for example, that the sound track will play in parallel to other instances. You can decide, on the other hand, that only one instance can play at any one moment. These options are called sync options. Flash has four different sync options: event, start, stop, and stream. You assign the type of the sync during editing. With event sync, Flash can play multiple copies of the same sound at the same time. It replicates itself while it is currently playing. This replication is often referred to as a new "instance" of the same sound. If you re-trigger an event sound while it is playing, it does not stop, rewind, and restart the sound. Instead, you get layering of multiple instances of the same sound playing at the same time.

The following link plays a scale passage when moused over. Quickly mouse the link over and over again. A new instance starts every time you mouse over the link, creating a pile up of multiple instances. Try it:

Play a Scale

Here is the code for the above link:

<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.embedSWF("scale.swf");
</SCRIPT>
</BODY>
</HTML>

Next: How to smooth track transitions

http://www.internet.com


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger


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/3.html