Join Paul Trani for an in-depth discussion in this video Adding audio to dynamically created buttons, part of Creating a Portfolio Web Site Using Flash CS4 Professional.
One issue you might run into is how to add sound to buttons that are created…with ActionScript and that's what's going on here with this portfolio, because…I want to add just some click sounds when the user clicks on any one of these portfolio items.…So that's what I want to do.…I am going to close this SWF and I am going to go to the Timeline.…So within this portfolio.fla, I need to open up that ActionScript layer,…this very first frame.…
I am going to go to Window>Actions.…So here's where all my code is written and right down here when you click on…any one of the images, it's going to fire off this function. This is where I…need to add my audio,…but I am going to start off at the very top.…Right up here at the top, I am just going to do two forward slashes so I can add…a comment and I am just going to type in SOUND.…This is where my sound item is going to go.…It's going to be a variable, so var clickSound is what I am going to make.…
I'm telling Flash that it's a sound and here's where I create a new sound…
- Optimizing and publishing a Flash web site
- Designing a professional photo or video portfolio
- Adding button interactivity
- Adding functionality to portfolio thumbnails
- Displaying content with XML
- Adding audio to portfolio presentations
Skill Level Intermediate
Q: While following along with the course, I encountered the following error in Flash CS4:
1120: Access of undefined property content_mc.
What is causing this error?
A: Flash is looking for something (the content movieclip) with the instance name “content_mc” but it is not finding it. Select the content movieclip on the stage. In the Properties panel give it an instance name of “content_mc”. Make sure there are no spaces before or after. That should resolve the error.
Q: What is the best strategy for integrating 720/60P HD video into a website? Would creating a blank page that opens in full HD resolution be the best way to view the full quality of the HD video file?
A: A video file that large would just be unreasonable for most users to open. These settings are a good place to start: 600x400is
Bitrate level: 1,000kbps
Bitrate Encoding: VBR These are just recommendations, and can be modified to preference. Also keep in mind that in Flash, one of the buttons that can be added is a full screen button, which is part of the skins.