Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Adding audio to buttons

From: Creating a First Web Site with Flash Professional CS5

Video: Adding audio to buttons

It's important to provide users with feedback to interactions that they perform on your site. That's what I want to do with these buttons when the user rolls over a button, I want to play just a quick rollover sound effect and then also when they click, I want to play a click sound. All right, so the first thing I need to do is import those sounds. So, I am going to File > Import, and I can Import to Stage. Notice that if I do Import to Library, it's going to do that same thing as well.

Adding audio to buttons

It's important to provide users with feedback to interactions that they perform on your site. That's what I want to do with these buttons when the user rolls over a button, I want to play just a quick rollover sound effect and then also when they click, I want to play a click sound. All right, so the first thing I need to do is import those sounds. So, I am going to File > Import, and I can Import to Stage. Notice that if I do Import to Library, it's going to do that same thing as well.

I'll select rollover.wav. Again, it could be an MP3 or other sound format so that imports that file. Let's go to File > Import > Import to Stage again, and I'll select this click.wav as well and click Open. Like I just mentioned, it does import them right into the Library as you can see. There is this click sound. Let's play it. (Click, click, click) And again it's going to be fairly subtle. Then near the bottom here I have this rollover WAV, so I'll click.

(Music plays) So, that's the rollover sound that I want. All right, so my tracks are imported, those audio files, and I need to add them to these buttons. Luckily, these are all instances of the generic button, so all I need to do is just double-click on any one of them to edit it. Now, notice in my Timeline what I can do is just add a new layer, and I can rename this layer Audio.

All right, right in here for the Over state, like I just mentioned, I want to go ahead and play a track. So, I need to insert a keyframe at that point in time and on this keyframe, I want to add the appropriate audio track. So, let me open up my Library. I am going to select this rollover.wav, and I am just going to drag it right on to the Stage and notice how it adds that waveform to that Timeline. All right, I am going to select that keyframe there and I am just going to double-check my sound.

It does say rollover.wav. The Sync is set to Event so that looks really good. In next frame, again it's the same process of inserting a keyframe, and now I can go ahead and add the click.wav right here. I'll just drop that right on. I can see that waveform in there, giving me visual feedback that it actually put on that audio track in there. I can check the Sync is set to Event as well and I am good to go. So, again this was to the generic button and if I click on Scene 1, it actually again adds it to the generic button which is being used five times.

Okay, so let's go ahead and check this out. I'll go to Control > Test Movie. So, let's listen to these sound effects. (Rollover sound and clicking) All right, so that sounds pretty good. I personally think the rollover sound is kind of loud so I want to edit that. The great thing is that I don't have to go out to my actual sound file, edit it, and then reimport it.

What I can do is I can actually edit it right in Flash. So, I am going to just double-click on that generic button. Go to that Over sound. Sure enough, here's that rollover.wav and what I can do is just this Edit sound envelope icon right there, and now I can see my waveform here. All I need to do is grab this control bar, and I can go ahead and move that down so it's about halfway, sort of part of that lower quarter area right down here. That's where I will put it. So, it's only about the quarter of the way up.

Now, let's play it. (Rollover sound playing) Again, I am going to keep this really subtle. I don't want to annoy users with audio. I just want to provide some feedback so they know that they are sort of interacting with this site. Okay, that was just a quick way to edit the sound envelope. Notice that when I do go back into Edit sound envelope, what I can also do if I want it to trail out a little quicker, I can even click here and add another keyframe and adjust the audio so it trails out a little faster.

All right, let's go to Test Movie. (Music plays) Now, remember the rollover sound is going to be a lot more subtle so-- (Rollover sound plays) Just like that. So again, just providing some user feedback to their interactions that they are performing on the site. As you can tell, it does really add a nice dimension to sort of any web project you might be working on.

Show transcript

This video is part of

Image for Creating a First Web Site with Flash Professional CS5
Creating a First Web Site with Flash Professional CS5

34 video lessons · 28191 viewers

Paul Trani
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating a First Web Site with Flash Professional CS5.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.