<< Chapter < Page Chapter >> Page >

According to The Adobe Flash Builder 4 and Flex 4 Bible by David Gassner,

When you compile a Flex application, your MXML code is rewritten in the background into pure ActionScript 3. MXML can be described as a "conveniencelanguage" for ActionScript 3 that makes it easier and faster to write your applications that if you had to code completely in ActionScript.

Easier and faster is debatable

In my opinion, as a person with many years of object-oriented programming experience, it is debatable whether coding ActionScript programs in Flex is easier and faster than coding them in pure ActionScript. Any program that can be coded in Flex can also be coded in pure ActionScript, but the reverse isnot true.

XML, not ActionScript

In any event, the purpose of the lessons in this series is to teach XML and not to teach ActionScript programming. (ActionScript OOP is a different course that I teach at the college.) Therefore, insofar as practical, the lessons in this series will concentrate on Flex programming and not on ActionScript programming.

However, to understand the differences between Flex 3 and Flex 4, it will sometimes be necessary to refer to ActionScript, particularly insofar as thedocumentation is concerned.

Preview

Run the Flex program named Namespace02

If you have the Flash Player plug-in (version 10 or later) installed in your browser, click here to run the program that I will explain in this lesson.

If you don't have the proper Flash Player installed, you should be notified of that fact and given an opportunity to download and install the Flash Playerplug-in program.

Namespaces is an XML concept

The concept of namespaces is an XML concept. It is not a concept that is exclusive to Flex. However, because Flex is an XML-basedprogramming language, Flex makes heavy use of namespaces.

I explained the concept of XML namespaces in the earlier lesson titled XML - Namespaces - Flex 3 . I also presented and explained a relatively simple Flex program that illustrated the use of XML namespaces to resolve nameconflicts.

Some of the differences between Flex 3 and Flex 4

In this lesson, I will present a somewhat broader view of namespaces and will also present and explain a program that illustrates some of the differencesbetween Flex 3 and Flex 4.

In explaining the differences between Flex 3 and Flex 4, I will need to dig a little more deeply into the Flex programming language than was the case in theearlier lesson.

The program that I explained in the earlier lesson was written exclusively using Flex 3. The program that I will explain in this lesson was writtenexclusively in Flex 4. The new Flex 4 program approximates the look and feel of the Flex 3 programfrom the earlier lesson.

Discussion and sample code

Two ways to create Flex projects

As I explained in the earlier lesson, Flex projects can be created using nothing more than a texteditor and a Flex software development kit (SDK) that is freely available from the Adobe website. However, to make the development of Flex projects a littleeasier, Adobe previously sold a product named Flex Builder 3 and now sells a replacement product named Flash Builder 4 , which includes the Flex 3 and Flex 4 SDKs along with avisual project editor.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to xml. OpenStax CNX. Dec 02, 2014 Download for free at https://legacy.cnx.org/content/col11207/1.18
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to xml' conversation and receive update notifications?

Ask