Start learning with our library of video tutorials taught by experts. Get started

Creating a First Web Site with Flash Professional CS5
Illustration by

Adding audio to buttons


From:

Creating a First Web Site with Flash Professional CS5

with Paul Trani

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.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Creating a First Web Site with Flash Professional CS5
2h 45m Beginner Jul 27, 2010

Viewers: in countries Watching now:

Creating a First Web Site with Flash Professional CS5 shows how to make a fully functional, dynamic web site in Flash Professional CS5. This course covers the fundamentals of creating and importing content, adding smooth 2D and 3D transitions, and adding button functionality that goes beyond links. This course will also show how to integrate and control video and audio as well as how to implement a gallery and a contact form. Exercise files are included with the course.

Topics include:
  • Understanding web design
  • Creating buttons and web graphics in Photoshop
  • Formatting text with the Text Layout Framework
  • Using the Timeline
  • Creating a custom looping animation
  • Loading images in a gallery
  • Creating invisible buttons
  • Adding music and video to a site
  • Customizing video playback controls
  • Optimizing and publishing a web site
Subjects:
Web Interaction Design Projects
Software:
Flash Professional Illustrator
Author:
Paul Trani

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.

Find answers to the most frequently asked questions about Creating a First Web Site with Flash Professional CS5.


Expand all | Collapse all
please wait ...
Q: I followed all the steps and suggestions in the "Adding a progress bar" video, but when I add the progress bar to my web site, I can’t remove it once the index.swf file loads up. The progress bar remains on the homepage and the rest of the pages. How do I make it disappear once the site loads?
A: To make it disappear, just make sure the progress bar is only in frame 1. If it’s on its own layer, then right-click on the 2nd frame in that same layer and select "Insert Blank Keyframe." That will make it disappear.
Q: Despite following the steps in the "Adding a progress bar" video, I cannot figure out how to keep the progress bar from appearing on a movie that has finished loading. How can I make the progress bar disappear?
A: Just add the red line below to the preloader.fla file. This will make the progress bar invisible: 
"function contentLoaded(evt:Event):void { //Optionally change to a clip holder and set progressbar visibility. addChild(contentLoader); progressbar.visible = false; }"
 
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.
Upgrade now


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 Upgrade now

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

Notes cannot be added for locked videos.

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.