| Getting Started with Flex 2 > Lessons > Retrieve and Display Data > Insert and position the blog reader controls | |||
In this section, you create the layout of your blog-reader application.
|
NOTE |
|
For the purpose of these lessons, several application files are used in a single Flex Builder project. However, it's good practice to have only one MXML application file per project. |
The layout should look like the following:
The BlogReader.mxml file should contain the following MXML code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel x="10" y="10" width="475" height="400" layout="absolute" title="Blog Reader">
<mx:DataGrid id="dgPosts" x="20" y="20" width="400">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
<mx:DataGridColumn headerText="Column 3" dataField="col3"/>
</mx:columns>
</mx:DataGrid>
<mx:TextArea x="20" y="175" width="400"/>
<mx:LinkButton x="20" y="225" label="Read Full Post"/>
</mx:Panel>
</mx:Application>
A browser opens and runs the application.
|
NOTE |
|
The browser must have Flash Player 9 installed to run the application. You have the option of installing Flash Player 9 in selected browsers when you install Flex Builder. To switch to a browser with Flash Player 9, in Flex Builder select Window > Preferences > General > Web Browser. |
The application doesn't display any blog information yet.
The next step is to retrieve information about recent blog posts. You can use an RPC service component called HTTPService to accomplish this task.
Flex 2.01