11. Drag an Image component next to the Panel. This component will display our images and has
an ID of display_img. Set the Layout constraints as shown in Figure 12-17.
Figure 12-17. Image component with layout
12. Drag a VideoDisplay component out and place it in the same area as the image component.
Scale it until it is approximately the correct size (Figure 12-18). If you are concerned with getting
the best video image, the size of the video display should be a multiple of the size of the
original video. The ID for the VideoDisplay is display_vid.
Figure 12-18. VideoDisplay component with layout
248
CHAPTER 12
13. In the Category view of the Properties panel, set autoPlay to true and visible to false. This means
that the video won??™t be visible until we make it visible in our function (Figure 12-19).
Figure 12-19. Properties for VideoDisplay component
249
FLEX AND AIR
14. Add a Text component below the image display. This component will tell us what kind of media
is currently selected. The ID for the component is currentMediaType and the Text property is
Current Media is: (Figure 12-20).
Figure 12-20. Text component that displays the file type
15. Run the project.
Running the project will show you the current project. The shortcut keys are the same for running an
AIR application as before: Shift+Ctrl+F11 (Windows)/Shift+Cmd+F11 (Mac). Notice that the project
did not open in a browser as our previous Flex projects have. Instead, it opens in a program called AIR
Debug Launcher (ADL).
Pages:
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173