In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to use Flex component development", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use Flex component development" this article.
Develop using Flex components
Probably the most important use of ActionScript in Flex applications is to use visual controls and containers for development. Flex provides several techniques to do this, including referencing Flex controls with ActionScript and manipulating properties of instances of controls and containers.
Reference Flex components
In order to use a component in ActionScript, we usually define an id attribute for the component in the MXML tag. For example, in the following code, we set the id property of the Button control to "myButton":
If you don't want to manipulate this component by using ActionScript, then this property is optional.
This code causes the MXML compiler to automatically generate a public variable with the name myButton that contains a reference to the Button instance. You can manipulate Flex components in ActionScript by using this automatically generated variable. You can explicitly reference an instance of the Button control through the id of the component in any ActionScript class or block of code. By referencing an instance of a component, you can modify the properties of the component and call the method of the component.
For example, in the following block of ActionScript code, the program changes the value of the label property of the Button control when the user clicks the button:
The id properties of all MXML components, no matter how deeply they are nested, generate public variables of the components that have been defined. Therefore, all id attributes in the document must be *. This also means that if you specify the id property of the component instance, you can manipulate the component anywhere in the program: functions, external class files, imported ActionScript files, or embedded code.
◆ if the Flex component does not have an id attribute, you can reference the component by using the component's container. Such as the getChildAt () and getChildByName () methods.
You can refer to the current attached file or the current object to use such keywords.
You can also refer to a component by using the same characters as the component name. To use objects in a program, you can use square brackets, which contain the same string as the component name. So you get a reference to the object.
In the following example, you get a reference to the object by using a string, and then change the style of each Button control:
These are all the contents of the article "how to develop with Flex components". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.