Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common Flex style definition types

Shulou Source: shulou.com Published: 2022-06-02 08:04:26 09月30日 Update

This article is about what common Flex style definition types are. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Flex style definition type

1. External Flex style sheet

Flex calls the global Flex stylesheet global.css, which is defined by flex-config.xml, such as:

/ WEB-INF/flex/global.css

The system default Flex stylesheet file global.css file does not have any Flex style definition, we can manually add the global Flex style, or we can change the default global Flex style file path. For example, the global Flex style file should be:

/ css/styles.css

Incidentally, there are four ways to define color Flex styles when defining external css files:

1:.myclass {fillColor:#6666CC} / / hexadecimal color format

2:.myclass {borderColor:rgb (77%, 22%, 0%)} / / RGB color format

3:.myclass {errorColor:rgb (0555)} / / decimal RGB color format

4:.myclass {color:Blue} / / VGA color name format

two。 Local Flex style definition

Use to define the Flex style of the current file

The following example defines the myFontStyle subclass Flex style. To use the corresponding Flex style, you can use the styleName property in the component to apply the Flex style.

1. 2..myFontStyle {fontSize:15} 3. 4.

The following Flex style defines the Flex style for all Button components, and Flex styles defined in this way do not need to specify a Flex style name when used.

1. 2.Button {fontSize:15} 3. 4.

3. Embedded Flex style definition

For individual components that require special handling, you can use the following ways to embed Flex style definitions

4. Use script Flex style definition

This method uses Flash's traditional AS scripting method to define Flex styles, which is more flexible, and can use the StyleManager class and the getStyle () and setStyle () methods, as follows:

1. 2. 10.

If the three Flex style definitions are used at the same time, the priority is as follows: embedded Flex style > local Flex style definition (script Flex style definition) > external Flex style definition.

Thank you for reading! On "what are the common Flex style definition types" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Tags: Style file global mode color format type component script facet common content method time more article binary good practical powerful Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn Microsoft Apple OPPO Reno