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

Yehuda Shiran, Ph.D.
Doc JavaScript

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

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, 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