Create complex object with Mxml as follows
<fx:object id= "Alex" name= "Alex" catlog= "Dog" > <fx:size> <fx:object length= "55cm" height= "45cm" > <fx:detail> <fx:object look= "Nice" Sound= "Wang" /> </fx:detail > </fx:Object> </fx:size> </fx:object><fx:object id= "Hello" name= "Hello flex" catlog= "book" weight= " 0.8kg ">&NBSP;&NBSP;&NBSP;&NBSP;<FX:DETAIL>&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;<FX: Array> <fx:object name= " Page1 " content=" { {tiLe1: ' intro ', price:87} } " /> <fx:object name= "Page2" content= "{{words: ' intro ', Code:12}}" /> <fx:object name= "Page3" content= "{[' Keys ', 32,TRUE,{DW: ' sa ', Df:1},{tt: ' SDA ', Ew:false}]} " /> </ Fx:array> </fx:detail></fx:object>
Create Object using <fx:Object> tags in mxml, simple type attributes can be written directly into attribute, complex attributes, can be written as sub-attributes with
<fx: Attribute name > < namespace prefix: Class name ></namespace prefix: Class name ></fx: Property name >
Format to create a complex object. This format can be nested continuously, creating complex multi-layered nested objects (of course, too complex object, rather than directly in the FX:SCRITPT block with the AS3 definition more intuitive)
If the complex object is an object or an array, it can also be declared with the "{}" Binding expression syntax in attribute, such as an object with the ID hello
The above code has passed the test without error.
Reference: http://blog.flexexamples.com/2010/10/20/creating-complex-data-provider-objects-in-mxml-using-flex-4/
Flex 4.6 creates complex object in Mxml