advanced Flex Application Development Building Rich Media X phần 7

Bộ xương ứng dụng của tôi luôn luôn bao gồm một loạt các lớp Singleton cho phép tôi để quản lý chức năng của một ứng dụng dễ dàng hơn nhiều so với khi không. Singleton lớp học, trong bối cảnh này, đề cập đến các lớp học ActionScript được mã hoá bằng cách sử dụng các mẫu thiết kế Singleton, | CHAPTER 10 Figure 10-13. The HSlider is now on top of the ProgressBar because it s wrapped in a Canvas. With the HSlider now on top of the ProgressBar it almost appears as though it were one component. However because you can see the track of the HSlider component it is still clear there are two overlaid components. To get rid of the track of the HSlider I use CSS and an invisible image. Using Fireworks I create a 1X1 invisible PNG file an empty 1X1 PNG file exported with transparency on and put it in my images folder in my Flex project. I embed the image as the trackskin. The MXML looks like this mx HSlider trackSkin @Embed source images The file is embedded using the Embed directive and when I compile the component looks as if it were just one as you can see in Figure 10-14. The only difference between this example and the RMX is that the video player for the RMX also has a skin applied to the thumb bar using the thumbDownSkin thumbOverSkin and thumbUpSkin properties of the HSlider component. I can assign images to those properties using the Embed directive like the example in the video player or I can embed it in the ActionScript and bind a reference to the class variable as demonstrated in Chapter 5. 286 WORKING WITH VIDEO Figure 10-14. The thumb bar of the HSlider now appears as if its track were the ProgressBar making it appear as if it were a single component. Playlists Now that I have all the controls for my video player the next step is to add a playlist. Obviously there are many different ways to load a playlist into a Flex application and I cannot cover them all and in any case that is not the purpose of this section. The purpose is to show how to handle the VideoDisplay component events so that I can play continuously off of any playlist. For the example I ve chosen to load an XML file which is one of the most common formats to consume data in. Whether you re working with an XML object array object or plain object the fundamentals are .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.