|
1. Import a new sound file onto your composition and set it as an event
sound in the Properties Palette. Adobe LiveMotion 2 enables you to import
wide a variety of file sound formats including AIFF, WAV and even MP3s.
There are tons of free sound loops out there. One good source is FlashKit.com.
2. Select your sound object once more and convert it into a (MC) Movie
Clip object. Rename the object to 'mymusic'. It's important to use proper
naming techniques when naming any object on your Composition epsecially
if you plan on referencing them within your scripts via the Script Editor.
3. If you imported a music loop object you'll probabely want to loop
it continiuesly. One convieninet way of doing so is to create a label
at the very first time interval at which your sound object's duration
bar begins, and name it start. Now, go to the very last time interval
at which the duration bar of the sound object ends and create the following
keyframe script:
| this.gotoAndPlay("start"); |
This script simply instruct the flash player that once your sound loop
comes to an end, go back to label named Start loacted on "this" object
and play the sound again. This process will continue infinately unless
another script overwrites it.
3. Now, create three additional MCs. You can use the rectangle tool to
create three small squares. These will be the buttons that will enables
us to pan our sound object. After doing so, convert each of them to a
MC as well. Lne them up in order and name the first one (starting from
the left) "leftspeaker", the second, "bothspeakers", and the right, "rightspeaker".
4. Select the "leftspeaker" MC and pop open the Script Editor. Select
the OnButtonRollover Event Handler and enter the following script:
pan = new Sound(_root.mymusic);
pan.setPan(-100); |
6. And finally, on your last MC, eneter the following script on its OnButtonRollover
Event Handler:
pan = new Sound(_root.mymusic);
pan.setPan(100); |
7. You're done. Hope it works for you.
Conclusion: When you preview your Composition you'll notice that the
sound playing will be effected by your mouse's action when rolling over
the three different MC that control the Pan. The first button which sets
the pan to "-100" will force your comp to play its sound from the left
speaker. It will continue to do so until you rollover over the remaining
MCs. The second, sets the sound object's Pan to "0", which sets your Computer
to play the sound evently between the left and right speaker. Finally
the last button sets the pan to 100, which forces your comp to play from
the right speaker. You may use any values between -100 and 100 when setting
pan.
You can view the effect on my site at:
http://www.livemotionstudio.com
|