1. Data Binding
<Mx: panel Title = "simple data binding" fontsize = "13" x = "225" Y = "180" Height = "138" width = "213" verticalalalign = "Middle"
Horizontalalign = "center">
<Mx: vbox>
<Mx: hslider id = "myslider"/>
<Mx: Text text = "{myslider. Value}"/>
</MX: vbox>
</MX: Panel>
Pull {}
2 model binding
<? XML version = "1.0" encoding = "UTF-8"?>
<Mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "absolute" fontsize = "13">
<Mx: Model id = "employeemodel">
<Employees>
<Employee>
<Name> john smith </Name>
<Department> Technical Department </Department>
<Email> john@163.com </Email>
</Employee>
<Employee>
<Name> Tom Steve </Name>
<Department> Human Resources Department </Department>
<Email> tom@163.com </Email>
</Employee>
</Employees>
</MX: Model>
<Mx: panel title = "using model components">
<Mx: DataGrid dataprovider = "{employeemodel. Employee}">
<Mx: columns>
<Mx: datagridcolumn datafield = "name" headertext = "employee name"/>
<Mx: datagridcolumn datafield = "department" headertext = "department"/>
<Mx: datagridcolumn datafield = "email" headertext = "email"/>
</MX: columns>
</MX: DataGrid>
</MX: Panel>
</MX: Application>
3. Use mx: object to bind
<? XML version = "1.0" encoding = "UTF-8"?>
<Mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" layout = "absolute">
<Mx: panel title = "using object components">
<Mx: DataGrid>
<Mx: dataprovider>
<Mx: Object Name = "John Smith" department = "Technology Department" email = "john@163.com"/>
<Mx: Object Name = "Tom Steve" department = "Human Resources Department" email = "tom@163.com"/>
<Mx: Object Name = "Fisher Steve" department = "Human Resources Department" email = "fisher@163.com"/>
</MX: dataprovider>
</MX: DataGrid>
</MX: Panel>
</MX: Application>
4. Tree list component
<? XML version = "1.0" encoding = "UTF-8"?>
<Mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml"
Fontfamily = "simsun" fontsize = "12"
Layout = "absolute" width = "242" Height = "442">
<Mx: panel title = "using XML components">
<Mx: tree id = "Tree" x = "10" Y = "35" width = "218" Height = "397" showroot = "false" labelfield = "@ label">
<Mx: dataprovider>
<Mx: XML id = "xmldata">
<Menus>
<Node label = "mail">
<Node label = "inbox"/>
<Node label = "personal folder">
<Node label = "Demo"/>
<Node label = "personal"/>
<Node label = "saved mail"/>
<Node label = "bar"/>
</Node>
<Node label = "calendar"/>
<Node label = "sent"/>
<Node label = "trash"/>
</Node>
</Menus>
</MX: XML>
</MX: dataprovider>
</MX: Tree>
</MX: Panel>
</MX: Application>
5. Verification
<Mx: numbervalidator id = "numv" Source = "{txtqq}" property = "text"/>
<Mx: Label x = "19" Y = "274" text = "QQ"/>
If & numv. Validate (). type = validationresultevent. Valid
{
... // verification passed
}< br> stringutil. trim (txtpassword. text) = "", where stringutil. trim is used to remove spaces
6 date formatting
[Bindable]
private var today: Date = new date (); // obtain the system time, stored in the date type
]>
formatstring = "Mmmm D, YYYY"/>
Verticalalign = "Middle">
<Mx: Label text = "unformatted Date: {today}"/>
<Mx: Label text = "formatted Date: {datedisplay. Format (today)}"/>
</MX: Panel>
</MX: Application>