spacer
Yehuda Shiran April 5, 2001
Maneuvering the Play Head in Flash
Tips: April 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

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

The most popular method supported by the FlashSound JavaScript API (FJA) is TGotoAndPlay(). Use this method to direct the play head to a certain frame and to a certain command inside the frame:

TGotoAndPlay(frame, label)

The file interactivesound.swf includes the frame beamscan. In this frame there are both stop and start labels. To send the play head to the beginning of the playback, do:

mySoundObj.TGotoAndPlay("/beamscan", "start");

To stop the playback, send the playhead to the stop label:

mySoundObj.TGotoAndPlay("/beamscan", "stop");

The naming convention in Flash is similar to the unix directory structure. A top-level frame is written as a child of the parent timeline. That's why the frame name begins with a "/". The second parameter is a label name inside the frame: "start" or "stop". Notice that there is no command in Flash to start a playback or stop it. Instead, you direct the play head to a label that the author of the SWF file inserted.


People who read this tip also read these tips:

Look for similar tips by subject:


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
UC Gaining a Foothold in Government · Workers Say Telework Is More Productive, Bosses Not So Sure · Kingston Debuts Power-Saving Memory Upgrades