Import and play a device sound

To play a device sound you can either attach it to the Timeline or use the Sound object to play the device sound with ActionScript.

  1. Create a new document from the Flash Lite 2.0 Symbian Series 60 document template, and save it as device_sound.fla.

    For more information about using the Flash Lite document templates, see Creating a Flash Lite document template.

  2. Select File > Import > Import to Library. On the Samples and Tutorials page at http://www.adobe.com/go/learn_flt_samples_and_tutorials, locate, download and decompress the ZIP file for your Flash Lite version, and then navigate to the Samples folder.

  3. Select the proxy.wav file and click OK.

Note: You can use any sound file that’s recognized by the Flash authoring tool as the proxy sound. The proxy.wav file is provided for your convenience.
  1. To link the proxy sound to the device sound file, do the following:

    1. In the Library panel, right-click (Windows) or Control-click (Macintosh) the proxy sound symbol and select Properties from the context menu to open the Sound Properties dialog box.

    2. In the Sound Properties dialog box, click the folder icon to the right of the Device Sound text box to open the Select Device Sound dialog box.

    3. Browse to http://www.adobe.com/go/learn_flt_samples_and_tutorials. On the Samples and Tutorials page, locate, download and decompress the ZIP file for your Flash Lite version, and then navigate to the Samples folder and select the file named hi_hat.mid.

    4. (Optional) To control the device sound with ActionScript, click Advanced to display the advanced sound properties options, select Export For ActionScript, and type device_sound in the Identifier text box.

    5. Click OK to close the Sound Properties dialog box.

      To play the device sound, you can either attach the proxy sound to the Timeline or use the ActionScript sound object. To use the ActionScript sound object, skip to step 6.

  2. To attach the device sound to the Timeline, do the following:

    1. Select the keyframe on Frame 1 on the layer named Content.

    2. In the Property inspector, select proxy.wav from the Sound pop-up menu.

      This attaches the proxy sound to the keyframe.

      The Flash authoring tool displays the proxy sound’s waveform in the Timeline. Waveforms for sounds that are linked to external device sounds are colored green; waveforms for sounds that are not linked to external device sounds are colored blue, as the following image shows.

      View full size graphic
      A.
      Sound linked to external device sound

      B.
      Sound not linked to external device sound

  3. To play the sound with ActionScript, do the following:

  4. Select the layer named Actions in the Timeline.

  5. Open the Actions panel (Window > Actions), and type the following code:

    var deviceSound:Sound = new Sound(); 
    deviceSound.attachSound("device_sound"); 
    deviceSound.start();
  6. Select Control > Test Movie to start the Adobe Device Central emulator and test your SWF file.