The top 10 things you shoshould know about flex)

Source: Internet
Author: User

 

The top 10 things you shoshould know about flex Submitted by schalk neethling on Mon, 2008/09/29-8:45 AM

Flex is getting a lot of buzz lately. A lot of people may be interested in using it just because they 've heard good things, but they aren't really sure if it fits in with their current skills or their project needs. in this article I'll discuss the top 10 things you need to know about flex, whether you're considering using it for your personal site or for your business.

1. Flex is web standards, redefined

mxml is the standard language for flex applications, as it allows a developer to draw up the structure of the application-including not only the layout but the class structure as well-in easy-to-ready markup. this makes it easy for people coming from a web design or development background, as mxml markup is analogous to HTML. similarly, the ActionScript within a flex application is comparable to Javascript, and flex uses Web-standard CSS to control layout. it's also a great way to build the structure of an application, as the tree-like nature of the language melds perfectly with a typical application's container-component model. along with this, source code is easy to distribute, as it's not a binary ide-specific file, but simple human-readable text files.

It's worth mentioning that mxml is a kind of shorthand for ActionScript, The ECMA-compliant scripting language. this is because mxml gets converted into ActionScript 3 at compile time. thus, it's entirely possible to build a flex application in ActionScript 3, without using or learning mxml. for processing applications, however, mxml interspersed with ActionScript is the way to go.

2. Flex is flash (and then some)

If you're familiar with the lightweight vector animations and advanced user interfaces that flash has provided in the past, you're no stranger to flex. flex is built on top of Flash Player, the engine behind all Flash content. in this regard, there's nothing flash can do that flex cannot.

All of the filters, display programming, drawing API, and animations that are inherent in Flash are completely visible to flex. however, flex gives structure to flash applications, providing a nice set of user interface components and containers that help developers write powerful and scalable applications.

3. Flex just works

Extends companies are switching their software from Java to flex. this is because flex offers quota of the same benefits as Java-namely, cross-OS "write once" abilities and a modern object-oriented architecture, but in a much smaller package and with loads of extras. flex applications have the ability to work both as web-based software as well as desktop software (with Adobe AIR), and doing so can utilize a single code base.

Because Flex is built on top of the ubiquitous Flash Player, whatever you write will work on any machine that has the Player installed. and that's a lot of machines-the vast majority of Internet-enabled computers-with Flash Player 9 reaching into the high 90th percentile. flash Player shelters you from cross-browser inconsistencies, keeping your software free of silly bugs and bloated code, and software rewrites with new browser releases. animations and video will play the same on one machine as they do another. when you build your code for Adobe AIR, You'll instantly have a cross-OS desktop application, running on Mac OSX, windows, and Linux in one fell swoop.

4. Flex is server agnostic

Flex was made for data, and it can accept data in the most common formats and interact with the most common servers. this plugin des XML loaded either locally or remotely, JSP, PHP, ASP, ColdFusion-you name it. you can download information via HTTP or soap Web Services, and can even hook directly up to Java Server objects or transfer binary data over-the-wire. adobe AIR has the additional ability to read and write to sqllite databases. if you have a particle back-end service, chances are Flex is going to be able to use them-and in most cases it's going to be simple.

With a great set of service components in the framework, more often than not you'll be able to grab your data in a few lines of code, and bind it directly to UI components. if you find you need more refined control, you even have access to binary sockets and (in Flash Player 10) Even local files.

5. Flex is the look you want

the default look-and-feel of a flex application is highly retriable. due to the programmatic skinning at its core, a flex application can be styled to your heart's content-changing colors here and there, modifying opacity, or changing the shape and size of the most common UI controls. and all of this can be done through standard CSS. although, CSS is not a requirement, as mxml also allows one to modify styles and skins through simple markup. if you're using Flex builder, you have an entire WYSIWYG editor for your application, allowing you to draw or plug in graphics and have all of the CSS written for you. in addition to this, there's a ton of themes for flex applications, allowing you to change the entire look with a single line of mxml code.

It's worth noting that flex, unlike Java or Javascript, does not inherit the UI from the operating system in which it is run. that is to say, a flex application running in Mac OSX will not have buttons that look like Mac buttons, and calling a flex Alert box will not display a Mac alert sheet. flex has its own look and feel built in-but if that operating-system look is one of you're going for, there are a few themes available which can closely mimic this.

6. Flex is light, and fast

built on ActionScript 3, the flex framework is surprisingly Speedy. initialization times have been improved dramatically over ActionScript 2, and built-in support for lazy instantiation helps a great deal. using a new JIT (just-in-time) compiler, your code runs blazingly fast. rich data visualization and advanced animations are entirely possible without hogging the user's CPU. while lots of 3D animations have been the bottleneck in the past, new support in Flash 10 may help. there's even hardware acceleration for video, to take advantage of modern graphics processing cards.

Although some will argue otherwise, Flex is light, as well. while using a set of UI components will definitely be larger than made-from-scratch ActionScript coding, the components are small considering how powerful they are. in fact, a typical application built using an Ajax framework can oftentimes run larger than a similar flex application. the Flash Player itself is a download of a few megabytes, though it's often pre-installed on computers. it's also worth mentioning a new feature, called framework caching, can shave off a good part of the download for the framework components. this feature can store the standard flex UI components on the user's machine so that other flex applications will load instantly, without the overhead of downloading the entire framework. this can allow advanced applications that run under 100kb.

7. Flex is accessible

There has been a fuss over the accessibility of flash for some time, and for good reason. it's often misunderstood that Flash content is inherently not accessible, But that's far from the case. while there's a lot left to be desired, Flash has the ability to interact with screen readers. in fact, the flex framework of components has a very good implementation for accessibility for screen readers and keyboard navigation, and all that most flex developers will need to do is flip a switch to turn this on (it's off by default ).

In comparison with your Ajax components, flex fairs extremely well. this is because, while HTML is accessible as-is, creating a javascript framework around this often breaks limit native accessibility features. in contrast, flex has been built with accessibility in mind from the get-go.

8. Flex is Seo-compatible

in the past, building a website on top of the Flash Player was a search engine optimization (SEO) nightmare. this is because the software that's used to view web pages was not aware. SWF files, the binary file which flex applications are compiled. modern search engines eventually added the capability to read the internals. SWF files, such as hyperlinks and blocks of text, and this helped a bit.

However, the problem with building a site completely in Flash/flex is that the relationship of different views of the site-tabs, etc. -are not understood by the search engine bots. to them, it's just a single page (with maybe a bit of text ). with the way that flex applications are compiled, the readability of. SWF is even more difficult. fairly recently, Adobe released a special version of Flash Player just for search engine bots which will allow the bots to go much deeper, so many CT better results soon. however, if Seo is a primary goal of yours, it's not advisable to solely use flash for your site. it's still better to use HTML interspersed with Flash content, or to have the main page in HTML with a separate section in flash. note that mxml code gets compiled into. SWF, and this markup isn' t viewed by search engines.

9. Flex is free, and open

Flex is now fully open-source. the source code for the entire framework is released, and comes with every copy of the Flex SDK or flex builder. this means you can see how things work internally, as well as debug the framework and even modify it for your own use. what this means is a better framework, aided by you and other flex developers, from here on out.

Flex is also free-it's free to develop with the flex SDK and compile it using the free mxmlc compiler. unlike earlier versions, flex does not require a special (I. e. expensive) server to run. you simply create a compiled application and distribute this on your server of choice. of course, a copy of flex builder will cost you, if you decide to develop using this eclipse-based IDE. but the cost is not great, and prices were recently lowered on this premier development tool.

10. Flex is easy to learn

Flex is-dare I say it-easy to learn. mxml markup is surprisingly simple to understand, and takes away a lot of the complicated Syntax of developing in pure ActionScript. if you 've ever used HTML and CSS before, you're halfway there. once you 've learned the basics of mxml, you can begin to gently learn ActionScript, making your applications more interactive. the flex framework provides a robust set of user interface components that speed up development, and learning their basic use is a manageable task.

This is true especially once you begin using asdocs, the provided documentation for flex. asdocs is probably the most sophisticated and streamlined set of documentation for any programming language today. add to this the fact that the primary development environment, flex builder, helps you get started quickly, leader you have Ally structure your applications in design mode, and giving you the most common tasks at your fingertips. there are also a number of good books out there, ranging from absolute beginners in programming, to those switching to flex from another language, and everything in.

Original Author:
Alaric Cole, Author of "learning Flex 3," published by O' Reilly media, has been working with Flash technologies since the introduction of ActionScript. once flex came on the scene, he has focused primarily on flex development, creating enterprise applications with rich data visualization, interactive media, and advanced components. alaric continues to use flex in his daily work at Yahoo's prestigious Flash Platform team, leading development and consulting on the newest flash and flex projects within ss the company.

From: http://css.dzone.com/news/the-top-10-things-you-should-k

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.