13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with sound<br />

Sound example: Podcast Player<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

A podcast is a sound file that is distributed over the Internet, on demand or by subscription. Podcasts are usually<br />

published as part of a series, which is also called a podcast channel. Because podcast episodes can last anywhere from<br />

one minute to many hours, they are usually streamed while playing. Podcast episodes, which are also called items, are<br />

usually delivered in the mp3 file format. Video podcasts are also popular, but this sample application plays only audio<br />

podcasts that use mp3 files.<br />

This example is not a full-featured podcast aggregator application. For example, it does not manage subscriptions to<br />

specific podcasts or remember which podcasts the user has list<strong>en</strong>ed to the next time the application is run. It could<br />

serve as a starting point for a more full-featured podcast aggregator.<br />

The Podcast Player example illustrates the following ActionScript programming techniques:<br />

Reading an external RSS feed and parsing its XML cont<strong>en</strong>t<br />

Creating a SoundFacade class to simplify loading and playback of sound files<br />

Displaying sound playback progress<br />

Pausing and resuming sound playback<br />

To get the application files for this sample, see www.adobe.com/go/learn_programmingAS3samples_flash. The<br />

Podcast Player application files can be found in the folder Samples/PodcastPlayer. The application consists of the<br />

following files:<br />

File Description<br />

PodcastPlayer.mxml<br />

or<br />

PodcastPlayer.fla<br />

comp/example/progra<br />

mmingas3/podcastplay<br />

er/PodcastPlayer.as<br />

The user interface for the application for Flex (MXML) or Flash (FLA).<br />

Docum<strong>en</strong>t class containing the user interface logic for the podcast player (Flash only).<br />

SoundPlayer.mxml An MXML compon<strong>en</strong>t that displays playback buttons and progress bars and controls sound playback, for Flex only.<br />

main.css Styles for the application user interface (Flex only).<br />

images/ Icons for styling the buttons (Flex only).<br />

comp/example/progra<br />

mmingas3/podcastplay<br />

er/SoundPlayer.as<br />

comp/example/progra<br />

mmingas3/podcastplay<br />

er/PlayButtonR<strong>en</strong>derer.<br />

as<br />

com/example/program<br />

mingas3/podcastplayer<br />

/RSSBase.as<br />

com/example/program<br />

mingas3/podcastplayer<br />

/RSSChannel.as<br />

Class for the SoundPlayer movie clip symbol containing the user interface logic for the sound player (Flash only).<br />

Custom cell r<strong>en</strong>derer for displaying a play button in a data grid cell (Flash only).<br />

A base class that provides common properties and methods for the RSSChannel class and the RSSItem class.<br />

An ActionScript class that holds data about an RSS channel.<br />

Last updated 6/6/2012<br />

467

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!