Danh mục

Flash Builder 4 and Flex 4 Bible- P11

Số trang: 50      Loại file: pdf      Dung lượng: 919.04 KB      Lượt xem: 15      Lượt tải: 0    
Jamona

Phí tải xuống: 14,000 VND Tải xuống file đầy đủ (50 trang) 0
Xem trước 5 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Flash Builder 4 and Flex 4 Bible- P11: When Macromedia first released Flash MX in 2002, the product was branded as the newway to build Rich Internet Applications (known by the acronym RIA). The term wasinvented at Macromedia to describe a new class of applications that would offer thebenefits of being connected to the Internet, including access to various types of Web-based services,but would solve many of the nagging issues that had been inherent in browser-based applicationssince the mid-1990s....
Nội dung trích xuất từ tài liệu:
Flash Builder 4 and Flex 4 Bible- P11 Chapter 16: Managing Application Navigation recalculated and rendered anew on each visit to the page. The browser offers caching of image and other assets to speed up this process, but graphical presentation in a Web page is necessarily limited. l HTML and JavaScript aren’t interpreted identically by every Web browser. In fact, one of the most costly and time-consuming aspects of classic Web application develop- ment is testing, because you must test your application on each combination of operating system, browser, and version that you want to support. Some Web application vendors handle this issue by limiting the platforms on which an application is supported. For example, Intuit’s QuickBooks Online, while a powerful and reliable Web application, is supported only on Microsoft Internet Explorer on Windows and Safari on Mac — no Firefox users allowed! Understanding Flex Navigation Navigation in Flex applications is handled at two levels with navigator containers and view states. The difference between these strategies can be described as one of the amount of visual change during a move from one presentation to another: l Navigator containers. Use these when you want to replace a rectangular region of a Flex application (a view) with a completely different visual presentation. l View states. Use these when you want to modify an existing view, by adding or removing visual components or by changing components’ properties, styles, or event listeners. In some cases, either a navigator container or a view state can get the job done, but for the most part the choice is clear: Use a navigator container to move from one view to another, and use a view state to change an existing view.Cross-ReferenceDetailed information about view states is available in Chapter 13. n Using Navigator Containers You create a stack of views using one of the navigator containers provided in the Flex framework. The ViewStack class is the simplest of these navigator containers. You declare the ViewStack container as a parent container that nests a collection of view components and displays only one of its nested views at any given time. The ViewStack container doesn’t have any user interface controls that enable the user to select a current view, so it’s typically controlled either with ActionScript code or with navigator bar com- ponents that use the ViewStack as a data provider and dynamically generate interactive compo- nents to control navigation. 471Part II: Designing Flex Applications Declaring a ViewStack in MXML To create a ViewStack in MXML, declare an tag set. Then declare each nested container within the tag set. You can nest either pre-built containers from the Flex framework or your own custom components. The containers you nest within the ViewStack can be either layout or navigator containers.New FeatureThe ViewStack, TabNavigator, and Accordion navigator containers were originally designed so theycould only contain instances of the original MX container classes such as VBox, HBox, and Panel. This rule isenforced via the nested object’s inheritance hierarchy: Each of the components nested directly within aViewStack must include mx.core.Container as one of its superclasses. If you nest most Spark compo-nents directly in a ViewStack, a type coercion error is generated at runtime when the framework tries to castthe object as Container.To solve this, nest the Spark component inside a new component named NavigatorContent. This containerimplements a new interface named INavigatorContent, making it compatible with the MX navigator con-tainers. To use Spark containers in a ViewStack (or in its related navigator containers, TabNavigator andAccordion), nest them in an instance of NavigatorContent. n Each container nested within a navigator container, whether implemented as a ViewStack, TabNavigator, or Accordion, should have a label property. The label is an arbitrary String that’s used in many circumstances to describe the container’s purpose to the user. You don’t always need the label property, but if you bind the stack to a navigator container that gen- erates interactive components such as Buttons, or if you use the TabNavigator or Accordion containers, the v ...

Tài liệu được xem nhiều:

Gợi ý tài liệu liên quan: