Accessibility

Table of Contents

Using Sound in Flash Lite 1.1

Using Bundled Sounds in the Authoring Environment

At this point of the development of your project, you'll use the temporary (proxy) sound files that I mentioned in the previous section. These proxy sound files are portable. To replace a standard sound file with one that is the optimal format for mobile playback, link the file to the MIDI file or a sound bundle file that you want to publish with your Flash application.

Use the Sound Properties dialog box (select a sound file in your library, right-click [PC] or Control-click [Mac], and choose Properties) and the Flash Publish Settings dialog box (choose File > Publish Settings and select the Flash tab) to link the proxy sound file to an external nonsupported sound file. When you publish your project, Flash replaces the proxy sound with the externally linked sound. The SWF file generated when you publish contains the sounds in the appropriate formats for playback on a mobile device.

When adding device-specific sounds or sound bundles to Flash documents for playback on mobile devices, keep the following in mind:

  • This feature works only with event-driven sounds.
  • The Effect, Sync, and Edit options are not supported when linking a sound.
  • You must specify an external sound file for each sound in the project that you are developing.
  • The device sound file or the sound bundle file must be available during the publishing process. This file isn't needed for playback once you deploy your application on the mobile device.

What's this event sound that I've been talking about? Event sound is the ability to play sound independent of the Timeline; and any event can be used to trigger an event sound. The event sound must download completely before it begins playing, and it continues playing until either the end of the sound buffer has been reached or the triggered sound is stopped. It is also helpful to note that you can loop event sounds within SWF files. This keeps your file size small while providing constant sound.

Place the sounds you processed inside a FLA file.

  1. Download and unzip the sample files for this article.
  2. Open the blank_flashlite_sound_tests.fla file, located in the Blank folder. (The Completed folder contains the finished test file for your reference.) The majority of this file has been kept generic so that you can easily reuse its architecture in your Flash movies.
  3. Double-click the soundTest movie clip on the Stage. Then double-click the mySounds movie clip in order to enter its symbol-editing mode and examine its timeline. Notice that there are temporary audio files under the first three labels. There's a WAV file under the fourth label and an MP3 file on the fifth label (see Figure 4).

    The mySounds movie clip Timeline

    Figure 4. The mySounds movie clip Timeline

  4. Now return to the parent Timeline. Select the first button, open the Actions panel, and enter the following code:

    on (press) {
    	tellTarget("mySounds") {
    		gotoAndPlay("sound1");
    	}
    }
    

    Select the second button and enter the following code:

    on (press) {
    	tellTarget("mySounds") {
    		gotoAndPlay("sound2");
    	}
    }
    

    Select the third button and enter the following code:

    on (press) {
    	tellTarget("mySounds") {
    		gotoAndPlay("sound3");
    	}
    }
    

    Select the fourth button and enter the following code:

    on (press) {
    	tellTarget("mySounds") {
    		gotoAndPlay("sound4");
    	}
    }
    

    Select the fifth button and enter the following code:

    on (press) {
    	tellTarget("mySounds") {
    		gotoAndPlay("sound5");
    	}
    }
    
  5. Now open your library so you can substitute MIDI sounds for the temporary MP3 files. Open your library, expand the sounds folder, and select tempAudio01.mp3. Bring up its properties, click the little folder icon to the right of Device Sound, and go to your sounds folder. Select piano_01.mld and click open. Notice that the sound file name now populates the device sound field (see Figure 5).

    The Sound Properties dialog box of tempAudio01.mp3

    Figure 5. The Sound Properties dialog box of tempAudio01.mp3

  6. Click OK.
  7. Select tempAudio02.mp3 from your library, and then repeat steps 5 and 6, using soundTestBundler.fls as the substituted sound.
  8. Select tempAudio03.mp3 from your library, and then repeat steps 5 and 6, using Matilda.kar as the substituted sound.
  9. Now you need to make sure that you have the proper publish settings. Select File > Publish Settings. On the Flash tab, select Flash Lite 1.1 from the Version drop-down list and then select the Export Device Sounds check box.

    Verify the settings before publishing your Flash Lite 1.1 movie.

    Figure 6. Verify the settings before publishing your Flash Lite 1.1 movie.

  10. Publish your movie.

    Congratulations—you're finished. Transfer your file to a Flash Lite 1.1–enabled phone to test your file.