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

What are the things Flex programmers should know

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article shares some of the things Flex programmers should know. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

1. Flex is a web standard.

MXML is the standard language for Flex applications, allowing developers to develop application architectures that include not only presentation layers but also class structures. This is easy for web designers and back-office developers because MXML markup is similar to HTML. Similarly, ActionScript in Flex is comparable to JavaScript, and Flex uses web-standard CSS to control the presentation layer. It is also a good way to build application architectures, because the tree nature of the language makes it a good fit with a typical application container-component model. Therefore, the source code is easy to distribute because it is not a binary IDE specific file, but a text file suitable for human reading.

It is worth mentioning that MXML is a somewhat abbreviated representation of ActionScript, the scripting language from which ECMA is dependent. This is because MXML is converted to ActionScript3 at compile time, so it is entirely possible to build Flex apps using ActionScript3 without ever using and learning MXML. For many applications, however, using MXML in conjunction with ActionScript is a common approach.

Flex is Flash, then something else.

If you're familiar with Flash's lightweight vector animation and excellent user interface, you won't be unfamiliar with Flex. Flex is built on Flash Player, which is the engine for all Flash content. So there's nothing Flash can do that Flex can't.

All Flash display programming, API drawing and animation, Flex is also fully available. Flex, however, also provides architecture for Flash applications, providing a complete set of interface components and containers to help developers write powerful and extensible applications.

Flex is very capable.

Many companies migrate their software from Java to Flex. This is because Flex offers many of the same features as Java, such as cross-operating system "write once" capabilities and object-oriented architecture, but Flex packages are much smaller and many additional packages can be downloaded. Flex applications can be used for both web and desktop applications (with Adobe AIR) and do so using a separate codebase.

Because Flex is built on top of the ubiquitous Flash Player, whatever you write will run on the computer it's installed on, and computers with Flash Player 9 (mostly Internet-enabled computers) achieve a whopping 90% rate. FlashPlayer protects you from the pitfalls of browser transitions, protects your software from stupid bugs and lengthy code, and avoids code rewriting due to new browser releases. And sound plays equally well on every unit. When you write code for Adobe AIR, you instantly have a cross-OS desktop application that runs on Mac OS X, Windows, and Linux at once.

Flex has nothing to do with servers

Flex programmers should know that Flex is built for data and can accept data in most common formats and interact with all common servers. This includes locally and remotely downloaded XML, JSP, PHP, ASP, or ColdFusion-it's up to you. You can download information via HTTP or SOAP web servers and even interact directly with Java server objects or convert binary data online. Adobe AIR can read and write to SQL Lite databases. If you have a particular back-end server, Flex may use them as well, and in most cases it's pretty simple.

If you have a good set of service components in the framework, chances are you can get your data in a few lines of code and bind it directly to the UI component. If you need more fine-grained control, you can also connect to binary sockets and even download files (in FlashPlayer10).

Flex is what you want.

Flex programmers should know that the default interface for Flex applications is configurable. Thanks to the kernel's programmability skin, Flex apps can be tweaked to your liking-changing colors here and there, modifying transparency, changing the shape and size of UI controls, all through standard CSS. CSS is not a requirement because MXML allows developers to adjust styles and skins with simple markup. If you use FlexBuilder, your app has a full WYSIWYG compiler that you can use to create and insert graphics and have all the CSS written for you. In addition, Flex apps have a bunch of themes that allow you to change the look and feel with just one line of MXML code.

It's worth mentioning that Flex, unlike Java and JavaScript, doesn't inherit UI from the operating system it's on. That is, a Flex app running on Mac OS X doesn't have keys like Mac keys, and calling FlexAlert doesn't present Macalert tables. Flex has a built-in interface, but if the OS looks like you want it to, there are themes that will get you closer to what the OS looks like.

6.Flex is light and fast

Built on top of ActionScript3, the Flex framework is surprisingly fast. ActionScript3 significantly improves initialization time, and built-in support for delayed instantiation is also evident. With a brand new Just-in-Time compiler, your code will run very fast. Rich data visualizations and *** animations can be done without using the user's CPU. Since previous 3D animation has always been a bottleneck, the new support in Flash20 will solve this problem. There are even graphics hardware accelerators to take full advantage of modern graphics cards.

Despite some controversy, Flex is indeed light. Working with a set of UI components would certainly be larger than starting from scratch with ActionScript code, but given their power, these components are small indeed. In fact, typical applications built using an AJAX framework are often larger than a small Flex application. Although Flash Player is often preloaded on your computer, it's just a few megabytes of download. Also worth mentioning is a new component called framework caching, which can fetch a fair amount of downloads for framework components. This feature enables standard Flex UI components to be stored on the user's computer so that other Flex applications can be downloaded quickly without having to download the entire framework.

7. Accessible Flex

There has been a lot of debate for some time about whether Flash can be used by people with disabilities, and for a lot of reasons. Flash content is often misinterpreted as inherently inaccessible to people with disabilities, but this view is far from the truth. As users crave more and more, Flash is able to "interact" with screen readers. In fact, the Flex framework component has a great accessibility tool that provides navigation for screen readers and keyboards, and most Flex developers just need to turn it on (the default option is off).

Flex has more affinity than many AJAX components. This is because HTML often breaks many native disability support features by creating JavaScript frameworks. Flex, by contrast, has support for people with disabilities built into it from the beginning.

Flex is SEO compatible.

In the past, building a URL on FlashPlayer was a nightmare for search engine optimization (SEO). This is because the software used to browse web pages often "doesn't recognize".swf files, which are binary files compiled by Flex applications. Modern search engines eventually added the ability to read.swf files, such as hyperlinks and large amounts of text, which helped somewhat.

However, the problem with building websites entirely with Flash/Flex is that browsing relationships between different URLs such as site-tabs are not understood by search engines, which think it's just a single page (maybe a bit of text). Given the way Flex applies compilation, readability of.swf becomes more difficult. Just recently, Adobe launched a special version of FlashPlayer for search engine bots that allows the engine to search deeper and quickly return *** search results. However, if SEO is only your initial goal, then it is not advisable to use Flash to build your web page completely. It's better to use HTML with Flash content, or you can use HTML to build the home page and Flash to build some parts. Note that the MXML code compiles to.swf, which is not recognized by search engines.

Flex is free and open source.

Flex programmers should be aware that the source code for Flex's entire framework is public, as is every copy of Flex SDK and Flex Builder. This means that you can see how they work from the inside, as well as the debug process of the framework, and you can even modify them for personal use. Flex is also free--it's free to develop with the Flex SDK, and it's also free to edit with mxmlc. to compile. Unlike earlier versions, Flex also no longer requires special servers. You can easily create a compiled app and publish it to the server you want. Of course, if you decide to develop with an Eclipse based IDE, a copy of FlexBuilder is paid for. But it's inexpensive, and the original development tool has recently been reduced in price.

Flex is easy to learn

Flex, I dare say, is easy to learn. MXML is very easy to understand, removing many of the complex syntax developed with pure ActionScript. If you've worked with HTML and CSS, you're halfway through Flex. Once you learn the basics of MXML, you can start learning ActionScript to make your application more interactive. Flex framework provides a complete set of user interface components to speed up the development process, and learning their basic use is also very simple.

Thank you for reading! About "Flex programmers should know what things" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

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