In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what are the differences between Flex3 and Flex4, I believe that most people still do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The difference between Flex3 and Flex4
The Flex4 (code name: Gumbo) distribution has made major changes based on Flex3. Flex4 introduces a new component and skin architecture. But as a Flex3 developer, you may not have much trouble compiling Flex3 applications with Flex4, because one of the goals of the new release is to maintain backward compatibility with Flex3.
In this article, I will briefly outline the main purposes and architectural differences of Flex4 and introduce changes in components, layout, state usage, and effects. I'll also answer some questions about the situations you encounter when compiling Flex3 applications using Flex4. This article does not cover all the new features of Flex4. For more information, please read the new features of Flex4.
Necessary knowledge
This article assumes that you are familiar with Flex3Framework.
Migrate applications to FLEX4
When migrating Flex3 applications to Flex4, the steps are not complicated. Except for a few bug fixes and a slight change in the default theme, your application usually works (or better) as it does in Flex3. But you must pay attention to a few points.
◆ player dependency
Be sure to compile for FlashPlayer10. Flex4SDK requires FlashPlayer10 support.
The font selector requires a namespace
The CSS font selector names the Flex class style. For example, the following are font selectors for Button and DateField:
Button {cornerRadius:10;} DateField {color:#780800;}
Starting with Flex4SDK, namespaces are required when an application uses a font selector. If you only use MXML2006 namespaces in your Flex application, add the following default namespace declaration to CSS:
@ namespace "http://www.adobe.com/2006/mxml";...
If you use multiple namespaces in your application, you need to provide each namespace in CSS. For examples, see namespaces and packages in Flex4 later in this article.
In addition, if the application uses methods such as StyleManager.getStyleDeclaration ("Button"), the font selector must include its package. For example, the call to getStyleDeclaration () will be changed to StyleManager.getStyleDeclaration ("mx.controls.Button").
◆ theme change
The default theme for the Flex3 (MX) component is now the Spark theme. Therefore, when you compile an application using Flex4SDK, its appearance and size may be different. However, if you want to use the look and feel of Flex3, you can still do it, because Flex4 contains Flex3's Halo theme. To compile using the Halo theme, you can use the additional compiler parameter-compatibility-version=3.0. In FlashBuilder4, you can do this in the PropertiesPanel (property panel). In the PropertiesPanel (property panel), select FlexCompiler (Flex compiler) and click the UseFlex3compatibilitymode (using Flex3 compatibility mode) check box (see figure 1).
You can also change the theme from the default Spark theme to Halo through the "Properties"-> "FlexTheme" (Flex theme) panel. In the FlexTheme (Flex themes) panel, click the Halo theme (see figure 2).
Figure 2. Select "HaloTheme" (Halo theme) from "PropertiesPanel" (property panel)
If you choose to use the new Spark theme, note that many of the styles available for Halo themes cannot be used for Spark themes. Spark themes support only a limited number of styles. To understand which styles are available for Spark skins, you should refer to ASDoc. A theme is assigned to each style listed by each component. If no theme is specified, the style can be used for both Halo and Spark themes. Flex4 also adds a wireframe look designed for quick models. Wireframe themes do not support style changes.
In addition to theme changes, the default preloader for Flex4 applications has also been changed to mx.preloaders.SparkDownloadProgressBar. This lighter preloader can shorten some startup time. If you want to use the Flex3 preloader, you only need to change one line of code. Add the following to the Application tag: preloader= "mx.preloaders.DownloadProgressBar".
If you are migrating applications from Flex3 to Flex4, I do not recommend replacing individual Flex3MX components with their corresponding Flex4 components. This may not be a good way to invest time. You should switch to the Flex4 component architecture for new applications.
◆ automatic library location change
In Flex3, the automatic library is located in {sdk} / frameworks/libs, while in Flex4, it is in {sdk} / frameworks/libs/automation. Users should ensure that there is no copy of the automatic library in frameworks/libs.
Overview of ◆ FLEX4 Architecture changes
One of the important themes of Flex4SDK is "Design with heart". This goal involves creating a smoother workflow between designers and developers. To help achieve this, the framework clearly separates the visual part of the component from its remaining behavior. In Flex3, the code of a component includes logic centered on its behavior, layout, and visual changes. In Flex4, components are divided into classes, each of which is responsible for handling specific behaviors.
The above is all the content of the article "what's the difference between Flex3 and Flex4?" 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.