Game Development Reference
Here's how the Okqj` and Okqj`?d]jjah objects work together to play the Chimes sound.
1. First, you have to declare the Okqj` object. In the @kkn class, the Okqj` object is called [_deiao,
and is declared at the beginning of the class definition:
This refers to the actual sound file that you imported into the Library . Its type matches its sym-
bol name: ?deiao.
2. Next, you have to declare the Okqj`?d]jjah object. In the @kkn class, it's called
It's the job of the [okqj`?d]jjah object to actually play the sound.
3. Create the Okqj` and Okqj`?d]jjah objects. Like any other objects, you create them with the
4. Play the sounds. You do this by assigning the Okqj` object to the Okqj`?d]jjah object, like
The Okqj` object's lh]u method plays the sound. You can use this directive anywhere in the
class when you want the sound to play.
In the @kkn class, the chimes play when the [eoKlaj property becomes pnqa:
This has been a brief introduction to using sound in games, but it's by no means the end of it. For
much more information on using sound, visit Adobe's online documentation at dppl6++dahl*]`k^a*
_ki+aj[QO+=_pekjO_nelp+/*,[Lnkcn]iiejc=O/+ and see the chapter “Working with Sound.”