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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business