|

Working with Sound
For this tutorial we will consider three uses of sound in Director 8.
1. Basic importing for a background piece of audio. 2. Rollover images which create a sound.
3. Controlling sound – Fade in/out
Basic importing for a background piece of audio.
- Open Director, import several images and a piece of audio into your Cast. There are some sample audio files on H:drive in my folder (DWall)
- Click The Hide/Show Effects Button on the top right of your Score window. This will show an extra series of timelines. We are only concerned with the 2 audio channels.
- Position a series of pictures onto the Stage, just to smarten up the presentation and give the presentation some visuals to play.
- Drag the audio clip from your Cast onto Channel 1 in the Score. You will see that this has no visible effect on the Stage.
- Make sure that you have headphones plugged into the computer and click Play in Director. You should notice that the background audio is played automatically. The position of the sound file on the Score dictates when the audio begins. Try moving it further along the timeline, 60 frames for example (be sure to drag out any visual elements to last the same length of time). Click Play again and you should see that there will be a delay before the audio plays.
Rollover images which create a sound.
- To make sound start when you roll the mouse of the image you need to start a new movie in director and Import some images to create a basic visual rollover image.
- Drag your standard button member state image onto your Stage from the Cast window.
- Open up the Library Palette and select Animation/interactive from the top left dropdown. Left click and drag the Rollover Member Change behavior onto your image on the Stage. In the following menu choose the appropriate image as your rollover member.
- Click play and test your visual rollover by moving your mouse of the image on the Stage. If it works you can move on, if not go back and check the previous steps.
- Import a Sound file into your Cast but do not drag it onto your Score.
- Click on your rollover image on the Stage. Go to the Property inspector and click on the Behaviours Tab (Cog icon). Here we will edit the current rollover member behaviour and add a condition for playing the audio file.
- Click on the Rollover member change behaviour in the list and then select the Script icon to view the ‘Lingo’ scripting/coding for that behaviour.
- The list looks very long and confusing, but the only part we need to concern ourselves with is the part that looks like this:
- on mouseEnter me
- mysprite .member = my rollover
- THROUGH TO THIS
- on mouseLeave me
- mysprite ……….
- End
- We will modify this by adding a line of coding. Click you mouse at the very end of the line of coding which reads:
- mysprite .member = my rollover
- Press Enter on your keyboard. Now click on the icon named ‘Categorised Lingo’. In the dropdown menu choose Sound/Puppet Sound. This will add a line of coding underneath. It should now read something like this:
- on mouseEnter me
- mysprite .member = my rollover
- puppetsound WHAT CHANNEL, WHICH AUDIO FILE.
- end. mouseEnter
- You must now click on the scripting page and enter which channel the audio file you have used is in and which cast member the audio in question is. As we entered out audio into channel 2, replace WHAT CHANNEL with the number 2. The name of the cast member must be written in the form “name”. You must substitute the name of your audio file Cast member, be sure to use speech marks. For example if you used Channel 2 and the name of your audio file was Rockmusic then your scripting should read:
- on mouseEnter me
- mysprite .member = my rollover
- puppetsound 2 “Rockmusic”
- end. mouseEnter
- In order for the audio file to stop playing when you move your mouse away from the rollover image you need to add another line of coding. This time you need to add the same code to the section starting:
- on mouseLeave me
- mysprite .member ……
- end. mouseLeave
- this time when you add the Scripting from the ‘Categorised Lingo’ Sound/Sound Stop, you just edit the added scripting to read:
- sound (2).stop( )
- Setting the Audio channel as ‘2’ means that it will be forced to stop playing any sound in channel 2 when you roll off the image.
- For Director to process this addition to the scripting you must click on the Compile button (Lightening icon).
- Close down the scripting window and click on the Director Play button. Try rolling your mouse over the appropriate image on the Stage. You should find that you have a visual rollover as well as and audio clip playing. Roll off the image and the sound should stop.
- It’s worth noting here that you should separate channels for background music and sound effects.
- Background music – Channel 1
- Sound effects – Channel 2
Controlling sound – Fade in/out
- Here we will create buttons to fade sound in and out. Create a new move in Director File/New Movie.
- Import 2 pictures into your score and position them as button on your stage, Maybe one far left and the other far right. Import a piece of background music and drag it onto channel 1.
- Open up the Library palette and go to Animation/Interactive in the dropdown menu. Select and drag the Rollover Member Change behaviour onto each of the buttons. In each of the popup menus select an appropriate rollover state for the button.
- Select the first button and in the Property Inspector select the Behavious Tab (Cog icon). Choose the rollover behaviour from the list and click on the Script button. Find the appropriate section of code to edit. (This is that same as in part 2 of this group of tutorials.
- As with the last section you need to add a line of script after the following lines:
- on mouseEnter me
- mysprite .member = my rollover
- Click the Categorised Lingo button and choose Sound/Sound Fadeout.
- In the script that has just appeared in the Script window enter the channel as 1.
- Click Compile (Lightening icon) to process the changes.
- Pressing play should make the audio play automatically, but rolling the mouse over the first button image should make the background audio fade out.
- You could now try adding either some scripting to make the audio fade back up when you roll off the first image or making the second button on the stage fade the audio back up.
- It might also be worthwhile trying some of the other samples of Lingo scripting from the ‘Categorised Lingo’ menu.
|