Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to migrate Flex3 applications to Flex4beta

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to migrate Flex3 applications to Flex4beta, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

Migrate Flex3 applications to Flex4beta

When migrating Flex3 applications to Flex4beta, 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 dependence

Be sure to compile for FlashPlayer10. Flex4beta 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 Flex4beta, 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 Flex4beta 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 (Halo) component is currently the Spark theme. Therefore, when you compile an application using Flex4beta, it may resize and resize itself. However, if you want to use the look and feel of Flex3, you can still do it, because Flex4beta contains Flex3's Halo theme. To compile using the Halo theme, you can use the-compatibility-version=3.0 flag or use-theme as an additional compiler parameter to compile the application. In FlashBuilder4beta, you can do this by changing the "AdditionalCompilerArguments" (other compiler parameters) setting in the "FlexCompiler" section of the "Properties" panel (see figure 1). If you want to use other compiler parameters, make sure that the framework/themes/Halo directory is included in your source path.

Figure 1. Set other compiler parameters

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, including baseColor, color, contentBackgroundColor, focusColor, symbolColor, selectionColor, and rollOverColor. To use Spark themes to change visual parts such as borders or fillets on a component, you need to create a custom appearance. Flex4beta also adds a wireframe look designed for quick models.

In addition to theme changes, the default preloader for Flex4beta 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 Flex4beta, I do not recommend replacing individual Flex3Halo components with their corresponding Flex4beta components. This may not be a good way to invest time. You should switch to the Flex4beta component architecture for new applications.

The above is all the contents of the article "how to migrate Flex3 applications to Flex4beta". 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report