Developing the Jukebox Application

In the next sections, you will create both the SoundController component and the main jukebox movie code that is responsible for making this application work. All the subsequent code is contained within a single Flash document. Therefore, the first step in this process is to create a new Flash document named jukebox.fla and save it.

Adding the Sound Controller

The JukeboxController component is an essential part of the jukebox application. It is required to play the songs. The component uses two SoundController components so that one song can be queued while another is playing. Here are the steps to follow to complete the component:

  1. The jukebox controller requires the SoundController component from Recipe 13.16. If you completed that exercise, you should have a Sound Controller menu option in the Components panel, which contains a SoundController component. Otherwise, you can download and install the completed SoundController component from http://www.person13.com/ascb/components/soundController.zip.

  2. Once you have the SoundController component installed, create a copy of it in your jukebox movie’s Library by dragging an instance onto the Stage and deleting the instance. The symbol remains in the Library, even after the instance is deleted.

  3. Create a new movie clip symbol named JukeboxController.

  4. Open the linkage properties for the JukeboxController symbol using the Library panel’s pop-up Options menu.

  5. Select the Export for ActionScript and Export on ...

Get Actionscript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.