ABSTRACT

There are two class fi les we’ll need to establish to create this engine. The fi rst is the engine itself, SoundEngine.as. Within this fi le will be the publicly exposed SoundEngine class, as well as an internal “ helper ” class called SoundEngineObject. This object will store information about each individual sound as it is created to keep track of them. Because there is no reason to expose this object outside the engine, we include it in the same fi le as the engine and Flash will automatically assume it is an internal class. We’ll cover more about this class in a moment. The other fi le is a special type of event, SoundEngineEvent.as. This is the type of object the SoundEngine will dispatch when certain events occur within the engine, such as a sound reaching its end or an error in playing or loading a sound.