Game Development Reference
integrates nicely with Flash. Sony
s Sound Forge is another
excellent application, but it is expensive and is applicable only for
Windows. If you are budget strapped (and on a Mac), HairerSoft
Amadeus Pro and Freeverse
s Sound Studio are great options.
Audacity is a free, cross-platform, open-source editor with a num-
ber of options, but if you need to do any level of sound manipu-
lation greater than cropping and normalizing, it
s really worth the
money to spring for a higher end program. Links to the apps just
mentioned are available on this topic
Sounds are handled differently from all other media in Flash
because they have no visual representation. There are two ways
you can add sound to your game: through script and by, directly,
placing sounds on the timeline. This is the case with most elements
in Flash, except that when you add a button to the stage, for
instance, you can also access it through script. The same is not
true for sounds. A sound on the timeline is not accessible from
ActionScript and, therefore, cannot be controlled. This forces devel-
opers to carefully choose how they are going to handle sounds.
At first, the obvious choice would be to always play sounds
through script because it provides the most flexibility and control,
and for games, this is almost always the case. The exception
comes, however, when working with some animation. If a game
has any segments that consist of long sequences of animation, like
cutscenes, it makes more sense to play any accompanying sound
effects on the timeline. This helps during sequencing to line up
music or sound effects with the animation, and it
The reason it
s all right to use timeline sound effects this way is
because sequences like this are linear and noninteractive. The
sounds are not likely to get stuck in a loop or linger around in
memory because they weren
t disposed of properly.
The rest of the time, scripting is the best way to control sounds.
Because sounds don
t need to adhere to the hierarchical structure
of Display Objects, the best strategy is to create a generic sound
controller that can play any type of sound and control its basic
properties from anywhere in the game. To create this sound
ll dive into some ActionScript.
Figure 8.4 When creating long
sequences of animation, it makes
sense to use sound effects
played through the timeline.