The error indicates that the element "mx: script" is not restricted.
If the style component is added when you create a new component in flex, an error occurs.
(Error details)
<? XML version = "1.0" encoding = "UTF-8"?>
<Mx: style>
. Listtitle
{
Fontsize: 20;
Color: #339933;
}
</MX: style>
<Mx: DataGrid xmlns: MX = "http://www.adobe.com/2006/mxml"
Verticalgridlinecolor = "#666666"
Verticalgridlines = "true"
Editable = "false" enabled = "true" fontfamily = "verdana" headerstylename = "listtitle" fontsize = "12"
Showheaders = "true" paddingbottom = "0" paddingtop = "0" headerheight = "30"
Bordersides = "Left right bottom top"
Borderstyle = "solid"
Horizontalscrollpolicy = "off"
Tooltip = "For more information, see" bordercolor = "#049604" borderthickness = "1" color = "#049604">
<Mx: columns>
<Mx: datagridcolumn datafield = "Resources" headertext = "related resources" textalign = "center"/>
</MX: columns>
</MX: DataGrid>
Solution: Set <mx: style>... </MX: style> placed between new components, that is, the preceding component <mx: DataGrid>... </MX: Within DataGrid>.
As follows:
<? XML version = "1.0" encoding = "UTF-8"?>
<Mx: DataGrid xmlns: MX = "http://www.adobe.com/2006/mxml"
Verticalgridlinecolor = "#666666"
Verticalgridlines = "true"
Editable = "false" enabled = "true" fontfamily = "verdana" headerstylename = "listtitle" fontsize = "12"
Showheaders = "true" paddingbottom = "0" paddingtop = "0" headerheight = "30"
Bordersides = "Left right bottom top"
Borderstyle = "solid"
Horizontalscrollpolicy = "off"
Tooltip = "For more information, see" bordercolor = "#049604" borderthickness = "1" color = "#049604">
<Mx: columns>
<Mx: datagridcolumn datafield = "Resources" headertext = "related resources" textalign = "center"/>
</MX: columns>
<Mx: style>
. Listtitle
{
Fontsize: 20;
Color: #339933;
}
</MX: style>
</MX: DataGrid>