In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to explore the use of Flex applications in detail, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
We will focus on the concept of Flex application, including the use of time and behavior, how to add multiple pages in Flex application, and how to use Flex. I hope the introduction of this article will give you something.
I. the use of events and actions
The principle of a HTML application is that the client makes a request and gets a response from the server. In contrast, Flex applications are event-based / event-based. For example, when a user clicks a button, an event is triggered. The application itself, not the server, contains logic to identify events and act accordingly.
Modify the properties of a component when an event is triggered
When you operate on a component programmatically, in order to respond to an event, you must first reference it, and you need to give it an ID value, as shown below:
You can then add the behavior / behavior to the application and change the property value of the component when an event is triggered, like this:
When the button is clicked, the visible property value of the panel is set to false.
Use the ActionScript function
You can also do the same by writing the ActionScript function and calling it in the event, in which case the click event for the button component is as follows:
Mx:Script > mx:Panel > mx:Application >
The ActionScript function is defined in a block in the MXML file and then referenced to the click event of the button.
Separate ActionScript code
To better separate the ActionScript code from the MXML file, you can put them in a separate ActionScript file instead of as a function, and then import them into the MXML file, as follows:
Use behavior and transformation to enhance rich visual interaction
Flex applications are event-driven, which means you can use events to add rich visual interaction while the program is running. To implement it, you use an event trigger to describe a behavior.
In the previous example, the visible property value of the panel component is set to false and is therefore not visible. You can also use behavior to create stronger visual effects.
The following example creates a behavior that first creates an effect and then binds it to the component's hideEffect property (trigger):
When the close button is clicked, the panel component fades out rather than disappears.
Triggers and effects can also be combined into more complex behaviors called transformations / transitions.
Second, add polymorphic pages to the application
There are several ways to create polymorphic pages in a Flex application. You can use ViewStack components, create separate MXML files, or use view state. View state can be thought of as a predefined user interface layout composed of a component or a group of components. You can use the view state to show different visual effects for the program. Each view state is based on a basic state and is inherited and extended.
In a subsequent example, the underlying state changes when the user scrolls the mouse over the component.
When a view state is invoked (an event generated when the user's mouse scrolls over the component), an effect (or a transformation) changes the appearance of the user interface.
Whether you use view-state, ViewStack or MXML files depends on the scope you want to change from one page to another, the complexity of the user interface, and the architecture of the Flex program.
Start using Flex
Now that you have a basic understanding of the concept of Flex, let's start creating Flex applications.
◆ uses FlexBuilder
Create a Flex project (File > New > FlexProject) by using the new project wizard / NewFlexProjectWizard. All the tools needed to design, compile, and debug Flex applications are included in FlexBuilder.
◆ uses FlexSDK
Create a text file with the filename suffix MXML, add the basic elements of the MXML file (the first two lines of code in the above example), and then use the documentation (especially AdobeFlex2LanguageReference) to study the use of the various components. Compilation and debugging tools are provided on the command line.
On how to explore the use of Flex applications to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.