![]() |
|
|
||||||||||||||||||||||||||||||
|
The "Timeline Approach" in Conception In order to control playback of individual sounds in flash, developers often use specially constructed "sound only" timelines. Developers sometimes refer to this as the "timeline approach". The "timeline approach" uses a movie clip as a container for a sound or multi-sound mix. Most interactive sound in flash revolves around sounds set to event/start sync. Event/Start sync sounds behave in a similar manner as frame attached movie clips. They play independently of the timeline to which they are attached. However, unlike movie clips, event/start sounds do not have a frame based timeline nor do they have an instance name. Instead a sound plays on its own timing mechanism for its full duration including loops. Flash does not play event/start sounds directly using the play action. Instead event/start sounds begin playing when the flash playhead reaches the frame to which the sound is attached. At this point flash starts the sound playing and the playhead continues down the timeline. The sound plays to completion without regard for what is happening to the playhead in the "parent" timeline. An event/start sound can continue to play even if the playhead stops. Since there are no frames in an event/start sound and sounds have no instance name, there is no way to use actionscript to directly play or stop event/start sounds. The stop action cannot stop playback of an event/start sound because these sounds play independently of the playhead. The stop action only stops the movement of the playhead, not playback of event/start sync sounds. Therefore we need an alternative way to play and stop an event/start sync sound. Playing a sound is pretty obvious, just use the gotoAndPlay action to move the playhead to the frame containing the sound. But what about stopping a sound? This is accomplished by the stop option in the sync menu of the sound panel. Sounds set to stop sync are not really sounds but a kind of non actionscript sound command that stops playback of the specified sound. When the playhead reaches a frame containing the stop sync "sound command", flash stops playback of the specified sound. Even though the stop sync sound command causes a change in a sound's playstate, it is not like an action. You cannot call it at any time from actionscript. Instead you place the stop sync sound command on a movie clip's timeline and send the playhead to that frame or label to stop playback of a sound. This is the essence of how the "timeline approach" to flash interactive sound works. Using the gotoAndPlay action, we send the playhead to the frame or label containing a sound to start playback, and then to stop playback we send the playhead to the frame or label containing the corresponding stop sync sound command. Enough theory! Lets make some noise! The next section begins the tutorial on how to construct sound only movie clips. Tutorial Navigation: Discuss this tutorial/demo in the Flash Sonification Discussion forum. |
||||||||||||||||||||||||||||||