Accessibility

Control how sound plays through the right and left speakers


Russell Chun

 

Paul Robertson

H. Paul Robertson

Adobe
Blog

book cover

www.peachpit.com

 

Table of Contents

Created:
06 Dec 2006
User Level:
Advanced
Products:
Flash undefined or later

When you want more precise control of how a sound is playing through the left and right speakers, the Sound class in Flash® 8.0 includes the method setTransform(). This method allows you to set percentages that determine how much of the right or left channel plays through the right and left speakers. Using this method, you can make your sound switch speakers from left to right dynamically or switch from stereo to mono. To use setTransform() with the Sound class, you create a generic object and add properties to it that hold the information specifying the distribution of left and right sounds. The properties of the sound transformation object are ll, lr, rr, and rl (Figure 1).

properties

Figure 1: The properties of the object passed to the setTransform() method determine distribution of sounds between the left and right speakers. The first letter refers to the output speaker; the second letter refers to the input sound.

Requirements

To follow along with this article, you will need the following software:

Flash 8

Prerequisite knowledge:

Basic knowledge of Flash 8

About the authors

Russell Chun is a medical illustrator, writer, and teacher. He’s the author of this book’s previous editions, including Macromedia Flash MX 2004 for Windows and Macintosh: Visual QuickPro Guide. He develops instructional media for Benjamin Cummings, an educational science publisher. He has written numerous magazine articles on Flash, and he teaches Flash at the Graduate School of Journalism at the University of California at Berkeley.

 

H. Paul Robertson is a senior ActionScript developer/writer for the Flash Platform documentation team at Adobe Systems, currently working on Adobe AIR. Previously he worked as a web applications developer and has been the author or technical editor/reviewer of several books for Peachpit Press and O'Reilly Media. Paul is an Adobe Certified developer and holds a Masters degree in Instructional Systems Technology from Indiana University. When he's not developing RIAs and code libraries, writing about developing RIAs, or speaking at conferences about developing RIAs, Paul spends his time taking pictures, collecting kitchen gadgets, and trying to catch up to his three children's level of mastery of Legos, Star Wars trivia, and other equally important subjects.

Excerpted from “Macromedia Flash 8 Advanced for Windows and Macintosh: Visual QuickPro Guide” by Russell Chun and H. Paul Robertson © 2006. Used with the permission of Peachpit. To purchase this book, please visit www.peachpit.com.