Friday, January 27, 2012

How to Embed Audio Player in Flash


Adobe Flash is a development tool that adds a richer media experience to ordinary web pages. With Flash, you can embed scripts with the HTML document that can play audio or video files, Flash animations, or other interactive elements designed by the Flash developer. Getting started using Adobe Flash Professional requires knowing how to link media clips with a player control that can be embedded in the web page. The Flash media controller allows users to click on various audio clips and listen to the clips within the web page.


Instructions

1 Open Adobe Flash Professional and click the "Flash File (ActionScript 2.0)" option in the "Create New" section of the start-up menu.

2 Open the Components window by pressing "Ctrl" and "F7" on your keyboard.

3 Drag the "MediaController" object from the Components window onto the stage using your mouse. The stage is the white box in the middle of the Flash Professional program window. Make sure the object remains selected on the stage (the blue outline indicates the stage object selection).

4 Name the MediaController by entering "Myaudioplayer" (as an example) in the name field of the Properties window that says "< Instance Name>."

5 Adjust the size of the Myaudioplayer object on the stage changing the "W" (Width) and "H" (Height) values in the Properties window.

6 Drag the "MediaDisplay" object from the Components window onto the stage. Use your mouse to drag the display area so that is directly on top of the Myaudioplayer media controller.

7 Name the MediaDisplay by entering "Myaudiofile" (as an example) in the name field of the Properties window that says "<Instance Name>." Adjust the width in the Properties window using the "W" and "H" values so that it equals the width of the media controller.

8 Press "Shift" and "F3" on the keyboard to open the Behaviors window.

9 Click the "+" sign and select "Media" and "Associate Controller." Select "Myaudioplayer" underneath the "Root" icon.

10 Enter "Shift" and "F7" on your keyboard to open the Component Inspector window. Make sure the "Myaudiofile" media display object on the stage remains selected.

11 Select "MP3" from the Parameters tab of the Components window.

12 Enter the URL of the uploaded MP3 file and uncheck the "Automatically Play" option if you want the website user to select when file playback begins.

13 Select "File" and "Publish Settings" from the main menu. "Flash" and "HTML" should be checked by default in the Formats tab. Name the SWF and HTML files using the "File" fields next to these formats. Click the Folder icon to select the folder where you want the SWF and HTML files saved.

14 Click the "Publish" button at the bottom of the Publish Settings dialogue box to generate the SWF and HTML code.

15 Copy the SWF or HTML code into an existing Flash or HTML document to embed the audio player