Software can also play - MM's display layer solution: flex (1)

zhaozj2021-02-16  54

MXML, Macromedia Flex Markup Language

Christophe Coenraets, Macromedia Flex

[Original] http://www.macromedia.com/devnet/flex/Articles/paradigm.html

[Translation] Samhoo (Samhoophone@yahoo.com)

[Note] Please keep the full text

Macromedia Flex is a display server that developers can use it to develop a new generation of "complex Internet Applications). Complex Internet Applications combines the availability of desktop applications and the advantages of easy management of web applications.

Flex is an exhibition server installed at the J2EE application server or Servlet container. It has a wealth of user interface components that use XML-based tag language of these components, and object-oriented programming languages ​​that can handle user interaction. These technologies have brought us: using Flash player rendering complex Internet applications, developing using industrial standards and developers.

This article will focus on the key part of the Flex language.

In order to run the code mentioned in this article, you may need to join the Beta test of Flex. Flex is running on the J2EE application server like Macromedia Jrun, IBM WebSphere, Bea WebLogic, or Apache Tomcat. Flex will support the Microsoft .NET server.

Flex Language Introduction

Since the markup language and object-oriented programming languages ​​are widely used, the Flex language based on both technologies will also benefit.

The marker language is successful, and the arrangement user interface is relatively easy. MXML, which is introduced by Flex, XML-based tag language, will continue its success. And HTML is very like, you can use MXML to arrange the user interface. The same is based on XML-based marker language, MXML has a stronger structure, fewer syntax ambiguity than HTML. MXML has also introduced a richer label set than HTML. Such as: DataGrid, Tree, Tabnavigator, Accordion, and Menu, these are part of the standard label set. You can also extend the MXML tab and create your own components. In addition, the biggest difference between the two is that the user interface defined by the MXML is to operate with the Flash player, which will be more attractive relative to the traditional HTML, page-centric web application.

In addition to the arrangement of visual components, you can also use mxml to define other important aspects in applications. For example, you can define applications as a web service, or in the application, to prompt user progress.

However, the programming logic provided by the markup language is still difficult to meet the needs of users' interaction. In Flex, you can use the ActionScript programming language to write event listeners to meet this needs. ActionScript is a standard-oriented language based on ECMA-262 standards, and other programming languages ​​- Java and C # are very similar, so it is also easy to get started.

All in all, when writing a Flex application, you need to use MXML to set the user interface, and use ActionScript to write logic to respond to user interaction.

As a developer, you can manually write MXML with your own preferences (such as Eclipes or Intellij), or use Flex's "ready" development environment (current development code BRADY). Even if you choose to manually write MXML, you can still use the XML Schema provided by Flex, which provides you with code hint and code completion, code completion. The following example is a simple name called HelloWord.mxml. Source code for flex application. The application has two TextInput components that the content of Source TextInput is displayed in the Destination TextInput field when clicking COPY. The following example shows how to create an application with MXML and ActionScript: Define the user interface with MXML, and write copy logic with ActionScript for the event listener of the Button component.

Figure 1. Copy the text of Source TextInput to Destination TextInput in the HelloWorld program.

转载请注明原文地址:https://www.9cbs.com/read-24948.html

New Post(0)