User Guide
62 Working with Sound, Video, and Images
8. Drag an instance of the Play button symbol from the Buttons library to the Stage.
9. Drag an instance of the Stop button symbol from the Buttons library to the Stage.
10. Select the Play button on the Stage and open the Actions panel (Window > Actions).
11. Type (or copy and paste) the following code into the Actions panel:
on(press) {
myVideo.play();
}
12.
Select the Stop button on the Stage and type the following code in the Actions panel:
on(press) {
myVideo.stop();
}
13.
Publish the SWF file (File > Publish) and transfer it to your device for testing.
Playing a bundled video directly from the library
Earlier in this document (see “Using bundled device video” on page 58) you learned how to
import and play a single bundled device video. To do this, you imported the device video into
the library, added an instance of the video symbol to the Stage, and called the
Video.play()
method on the video instance.
You can also use a single Video object on the Stage to play multiple bundled device videos
directly from the library. To do this, you bundle the device video in your application’s library.
You also assign an identifier to the video symbol that lets you reference the video symbol with
ActionScript, as the following image shows:
NOTE
You must test a device video on the actual device; you can’t preview it in the
emulator.
Linkage identifier