Software can also play - MM's display layer solution: Flex (3)

zhaozj2021-02-16  50

Define your own components

In Flex, you can create your own components from the beginning or by extending components existing in the Flex component library. Creating a component is like creating an app: use the MXML to raise the user interface, write the interface logic with ActionScript.

One of the following examples is to create a simple credit card selection component by extending the VBox class.

Label = "American express" SELECTED = "true" />

The name of the component is the name of the source file. For example, the name of the source file is CreditCardchooser.mxml, the name of the component is CreditCardchooser, so that this tag name can be used. The following example uses the CreditCardchoose component that just created.

>>

Figure 3. CreditCardChooser application

Interface developers can also create complex visual components in the Macromedia Flash development environment and save them as SWC files.

Of course, it is also possible to define the entire component using only ActionScript, which is generally used to define non-visible components in the application. You may create non-visual components for such business objects - for example, a shopping cart with client logic, or a Helper class in your application.

转载请注明原文地址:https://www.9cbs.com/read-24946.html

New Post(0)