spacer
Yehuda Shiran April 29, 2001
Random Access in Stream Flash
Tips: April 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Biz Resources
Contact Management Software
Domain Name Services
Internet Security
Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0
FlashSound JavaScript API supports the CD Player-like capability of randomly accessing any frame on the track. You just specify the frame number you want to start playback at.

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 four links mimic a typical CD Player control panel. The left link rewinds the track and starts from frame #1. The second link starts from frame 100, and the third one from 200. The right link pauses all playbacks:

Play from Frame 1  Play from Frame 1000  Play from Frame 200  Pause

Here is the source code:

<HTML>
<HEAD>
<SCRIPT SRC="flashsound.js"></SCRIPT>
<SCRIPT>
  var mySoundObj = new FlashSound();
</SCRIPT>
</HEAD>
<BODY>
<A HREF="javascript://" 
  onmouseover="mySoundObj.TGotoAndPlay('/',1)">
  Play from Frame 1</A>
<A HREF="javascript://" 
  onmouseover="mySoundObj.TGotoAndPlay('/',100)">
  Play from Frame 100</A>
<A HREF="javascript://" 
  onmouseover="mySoundObj.TGotoAndPlay('/',200)">
  Play from Frame 200</A>;
<A HREF="javascript://" 
  onmouseover="mySoundObj.TStopPlay('/')">
  Pause</A><
<SCRIPT>
  mySoundObj.autostart = false;
  mySoundObj.embedSWF("earsonly.swf");
</SCRIPT>
</BODY>
</HTML>

Notice we assign autostart to false. The reason is that the stream example here was set to autostart upon embedding. We can override the Flash behavior with JavaScript commands.

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

Download flashsound.js

Download earsonly.swf


People who read this tip also read these tips:

Look for similar tips by subject:



JupiterOnlineMedia

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

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP