TAILIEUCHUNG - Adobe Flex 4 Training from the Source Volume 1 phần 10

Xem xét lại các hình ảnh từ trước đó, bạn sẽ thấy mục mua sắm xem hiện tại giỏ hàng của bạn ở bên trái và mua sắm xem đề xuất Giỏ hàng bên phải. Họ trông khá một chút khác nhau, nhưng có sự khác biệt chức năng cũng. Thay vào đó, nó là một hỗn hợp của nhiều thành phần khác nhau tương tác một cách cụ thể. | 432 LESSON 18 Creating Custom ActionScript Components Reexamining the image from earlier you will see your current shopping cart item view on the left and the proposed shopping cart item view on the right. They look quite a bit different but there are functional differences as well. When you are deciding on a base class you are trying to determine if there is another class that already does most of the needed work on your behalf. For instance earlier you created ProductList. You did so by extending the DataGroup and changing a few things to make ProductList a viable component for your needs. In this case you are making a component that has an area to display a list of items. It also has an area to display the number of items in the cart an area to display a total and a View Cart button. Unlike ProductList this component doesn t exactly mirror the functionality of any one Flex component. Instead it is a composite of many different components interacting in a specific way. As there isn t a component in Flex that provides you with the needed functionality it will be up to you to build it all. While doing so you are also going to allow for others in the future to change the way your component looks via skinning. Therefore you will use SkinnableComponent as your base class. Creating the Class You will begin building the component to replace the shopping cart items list currently in ShoppingView. Start by creating a new ActionScript class. 1 Open the FlexGrocer project that you used in the previous lessons. Alternatively if you didn t complete the previous lesson or your code is not functioning properly you can import the project from the Lesson18 start folder. Please refer to Appendix A for complete instructions on importing a project should you ever skip a lesson or if you ever have a code issue you cannot resolve. Download from Defining a Component 433 2 Right-click the components package in the Package Explorer. Choose New ActionScript

Đã 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.