You can manually insert a Flex data model in an MXML file or you can visually import it.
<mx:Model> tag.
For example, the following data model stores a person's name, age, and phone number:
<mx:Model id="myEmployee"> <name> <first>John</first> <last>Doe</last> </name> <department>Accounting</department> <email>jdoe@goodcompany.com</email> </mx:Model>
For more information, see "Using data models" in Developing Flex Applications Help.
Note: If the data model doesn't appear in the Data panel, click the refresh button on the panel.
This specifies the location of an XML file to use as a data model in the current MXML file.
After you click OK, Flex Builder inserts the data model in the file.
You could also hand-code an <mx:Model> tag with a source property that specifies an XML file or a URL that returns XML. The following are some examples:
<mx:Model source="content.xml" id="contact"/> <mx:Model source="http://www.somesite.com/content.xml" id="company"/>
Note: If you create a data model with the source property, you will be unable to visually create a binding to the model because the binding destination is in an external file.