———MXML标签和ActionScript类之间的关系

Adobe implemented Flex as an ActionScript class library. That class library contains components (containers and controls), manager classes, data-service classes, and classes for all other features. You develop applications by using the MXML and ActionScript languages with the class library.
    Adobe公司将Flex实现为一个ActionScript的类库。该类库包含组件(容器和控件),管理类,数据服务类和其他功能的类。你在开发应用程序时,可以用使用该类库的MXML和ActionScript语言。

MXML tags correspond to ActionScript classes or properties of classes. Flex parses MXML tags and compiles a SWF file that contains the corresponding ActionScript objects. For example, Flex provides the ActionScript Button class that defines the Flex Button control. In MXML, you create a Button control by using the following
MXML statement:
    MXML标签对应ActionScript类或类的属性。Flex解析MXML文件中的标签,将它们和ActionScript对象相应,并将它们编译为SWF文件。例如,Flex提供的ActionScript按钮类,它定义了Flex的Button控件。在MXML中,您通过使用下面的一个MXML声明来创建一个按钮组件:
<mx:Button label="Submit"/>


When you declare a control using an MXML tag, you create an instance object of that class. This MXML statement creates a Button object, and initializes the
label property of the Button object to the string “Submit”.
An MXML tag that corresponds to an ActionScript class uses the same naming conventions as the ActionScript class. Class names begin with an uppercase letter, and uppercase letters separate the words in class names. Every MXML tag attribute corresponds to a property of the ActionScript object, a style applied to the object, or an event listener for the object. For a complete description of the Flex class library and MXML tag syntax, see the Adobe Flex Language Reference.
    当你使用MXML标签声明一个控件时,您实际上创建了该类的一个实例对象。上面的MXML语句创建一个按钮对象,并初始化按钮对象的字符串label属性“提交”。
    一个对应一个ActionScript类的MXML标签使用和该ActionScript类相同的命名约定。类名大写字母以开头,并且不同的单词应该各自以大写字母开头。每个MXML标签的属性对应ActionScript对象的属性,适用对象,或对象的事件侦听对象。关于一个完整的Flex类库和MXML标记的语法说明,请参阅Adobe的Flex语言参考。

你可能感兴趣的:(Flex,Adobe,actionscript)