Free Webmaster Help Logo
Tutorials Articles Tools Images Directory Ask Newsletter
*
 

Tutorials
Cookies
ASP
Advanced HTML
Frames & Tables
.htaccess
Rounded Table Corners
Flash 5
FTP
Beginners
Javascript
PHP/MySQL
Site Promotion
Mobile Internet: WML/WAP
Server Side Includes (SSI)
HTML - The Basics
XHTML
Stylesheets
XML
PHP
*

125x125

Related Links
Macromedia Downloads
FlashKit
More Flash 5 Sites
*

 
Sitemap | Contact | Link To Us | Advertise
Report A Problem
Home : Tutorials : Flash 5 : Part 8

Flash 5 Tutorial
Part 8 - Sound

Introduction

In the past 7 parts of this tutorial I have showed you how you can create visual effects using Flash. In this part I will show you how you can create an even better user experience by using sound in your animation.

Importing Sounds

Before sounds can be used in your animation they must be first made available for the software to use. To do this you must use the standard Import menu. To access this go to File, Import. From here you can select each file you want to import (just as you did in an earlier part with images). The only confusing thing about this is that once you have imported your sound you will see nothing special on the screen. This is because the sound has been added to the library.

The Library

The library is not only for sound, but is actually one of the most useful parts of Flash when you start to create large movies with many elements. Basically, the library contains all the objects you have in your movie, the three types of symbol (movie, button and graphic) and all sounds. This can be very useful as, to add something to the movie from the library you just drag it to the position you want it on the stage.

You can also preview all the objects here, graphics will appear in the top window and if you select a button, sound or movie clip you can watch or listen to it by clicking the little play button which appears in the preview window. You should be able to see and preview any sounds you have added here.

Adding Sound

Sound is added using the sound palette. This is in the same palette as Instance, Effect and Frame. If it is not on the screen go to Window and choose Panels, Sound. The sound palette will probably be 'greyed out' at first. Insert a keyframe into your movie and click in it to make all the options available.



In the first 'Sound' box you can select the sound you want to play. If no sounds appear here, you have not yet imported any into your movie. Check the Library to see if any appear.

Now the effect box will be available. This is not particularly important just now. The next box is the Sync box. You can choose Event, Start, Stop and Stream. The only ones you really want to learn about at the moment are Event and Stream. They each have their own features.

Stream

Streaming sounds work like streaming audio on the internet. The sound does not need to be fully loaded before it starts playing, it will load as it plays. Streaming sounds will only play for the number of frames that are available for it (until the next keyframe). This is fine for background sounds but it will not work very well for a button.

Event

Event sounds are mainly used for when someihtng happens in your movie. Once they have started playing they will continue until they end, whatever else happens in the movie. This makes them excellent for buttons (where the button moves on to another frame as soon as it is clicked). The problem with Event sounds, though, is that they must fully load before they can play.

Adding A Streaming Sound

It is much easier to manage your sounds if you put them on a separate layer. Insert a new layer and place a keyframe at the beginning. Using the sounds palette select the sound you want to play and select Stream from the Sync. If you want the sound to loop change the value in the Loops box (for some reason a value of 0 (default) will cause the sound to play once).

Now you must insert some frames to give the sound time to play. Insert a frame (or keyframe) at about frame 500 in the movie (this will give most sounds time to play). When working out how many frames are needed remember that the movie will play at 12 frames per second. A graphical representation of the sound will appear in the frames it will be playing during so
that you can see how much space it takes up. Press CTRL + Enter to preview your movie.

With the sound on a separate layer you can have your movie running on other layers while the sound plays in its own layer.

Adding An Event Sound to a Button

Adding an event sound to a button is nearly as easy as adding a streaming sound. Either create a button or use a pre-made one and right click and choose Edit. This will allow you to see the 4 different states of the button (as you learned about in part 6. Usually sounds are placed in the Over or Down frames. To make a sound play when the mouse moves over the button choose Over and to hear it when the button is clicked choose Down.

Insert a new frame and then put a keyframe for the button state you want to use. Click in the frame and use the sounds palette to add an Event sound. You don't need to put in any extra frames as an event sound will play until it finishes. Now return to the movie and use CTRL + Enter to test it with the button.

Effects

The effects option allows you to add a variety of effects to the sound as it plays. The preset ones are quite self explanitary but you can also use the Edit.. button to create your own. This will open a window with the the waveform representation of the sound (left speaker at the top, right at the bottom). On the top of this is a line which is the volume control (the top is full volume (the volume the sound was recorded at) and the bottom is mute). By clicking in the window you can insert little squares. The line goes between these squares. You can also drag them around the screen. By doing this you can change the volume of the sound at different points throughout its playing time, and make it different for each speaker.

Part 9

In the final part of this tutorial I will show you how to export your animation for the web.

© 1999 - 2001 FreeWebmasterHelp.com