Macromedia flash 8-developing flash lite 2.x applications User Manual

Page of 94
Using device sound (Flash Professional Only)
53
c.
Browse to the flash_install_dir/Tutorials and Samples/Samples/Flash Lite/Sound/ and 
select the file named hi_hat.mid.
i
d.
Click OK.
13.
Select Control > Test Movie to start the Flash Lite emulator and test your SWF file.
In the emulator, press the Down Arrow key on the keypad to give the Play button focus, 
and then press the Select key to play the sound.
Triggering device sounds in Flash Lite 1.0
In Flash Lite 1.0, a device sound can only play in response to a user pressing a key on their 
device. There are two ways to satisfy this constraint. One way is to attach the sound to the 
Down frame in a button symbol’s timeline. When the button has focus, and the user presses 
the Select key on their device, Flash Lite plays the sound in the button’s Down frame. For an 
example of this technique, see 
The other way to trigger a device sound in Flash Lite 1.0 is to have the user press a key that 
sends the playhead to a frame in the timeline that contains a device sound. Any device sound 
at that frame plays when the playhead enters the frame.
For example, suppose your application has a button on the Stage on Frame 1, and a 
 
device sound attached to Frame 10. You attach the following 
on(press)
 handler to the 
button instance:
on(press) {
gotoAndStop(10);
}