Game Development Reference
Figure 8.3 You can set the
audio quality for all your
sounds that don ' t use custom
settings within the Publish
commonly used within games
ll look at a method for
using it in an unorthodox way to maintain frame rate.
but later we
Using External Files
t limited to playing sounds that are embedded within the
FLA. External MP3 files can be loaded in and played at runtime.
Although this feature doesn
t really make sense for individual
sound effects, music or other long sounds can work very well this
way. The SWF isn
t loaded down with the extra file size of the
audio and can stream it in over time, once the rest of the game is
loaded. Because you don
your initial load, it also makes increasing the quality (and, there-
fore, the file size) of the sound less of a concern. Below is a simple
bit of ActionScript that loads in an external sound.
var sound:Sound = new Sound(new URLRequest( " mySound.mp3 " ));
The one main drawback to this method is that it exposes your
MP3 file to anyone with an activity viewer in his or her browser.
Although you can copyright any assets of your game to prevent
others from using them commercially, it does not prevent someone
from stealing the individual files.
Tools for Working with Sounds
Probably the best choice for working with sound in Flash is
s SoundBooth. It is cross-platform, and it supports multiple
tracks for doing more complex mixing. It is reasonably priced and