Introduction to Flex - Flex Languages: MXML and ActionScript 2.0
(Page 2 of 5 )
You use two languages to write Flex applications: MXML and ActionScript.
MXML is an XML mark-up language that you use to lay out user-interface components. You also use MXML to declaratively define non-visual aspects of an application, such as access to data sources on the server and data bindings between user-interface components and data sources on the server.
Like HTML, MXML provides tags that define user interfaces. MXML will seem very familiar if you have worked with HTML. However, MXML is more structured than HTML, and it provides a much richer tag set. For example, MXML includes tags for visual components such as data grids, trees, tab navigators, accordions, and menus, as well as non-visual components that provide Web service connections, data binding, and animation effects. You can also extend MXML with custom components that you reference as MXML tags.
ActionScript is an object-oriented programming language which you use to write programmatic logic for responding to both user-initiated and system-initiated events at runtime. The object-oriented programming (OOP) features in ActionScript 2.0 are based on the ECMAScript 4 Netscape Proposal (www.mozilla.org/js/language/es4/index.html). Because the ECMA-4 proposal is not yet a standard, and because it is still changing, ActionScript 2.0 does not conform exactly to this specification.
One of the biggest differences between MXML and HTML is that MXML defined applications are compiled into SWF files and rendered by Macromedia Flash Player, providing a richer and more dynamic user interface than page-based HTML applications do.
MXML does not use concepts specific to Flash, such as the timeline and library. However, you can always use the Flash authoring environment to create or modify components for use in Flex.
You can write an MXML application in a single file or in multiple files. MXML supports custom components written in MXML files, ActionScript files, and files created using the Flash MX 2004 authoring environment. Some MXML tags, such as the <mx:Script> tag, have a property that takes a URL of an external file as a value. For example, you can use the source property in an <mx:Script> tag to reference an external ActionScript file instead of typing ActionScript directly in the body of the <mx:Script> tag.
Next: About ActionScript 2.0 in MXML applications >>
More Flash Articles
More By Adi Reddy Mora