User Guide

Tutorial: Binding components to data with Flex Builder 45
6.
In Code view, locate the <local:GridView> tag and add the following property (shown in
bold type):
<local:GridView xmlns:local="*" id="gridView" dataObject="{catalog}" />
7.
Save the flexstore.mxml file.
8.
Make sure the Flex server is running and then press F12 to test the flexstore.mxml file in a
browser.
If the thumbnail view is showing, switch views by clicking the grid view button at the lower
edge of the catalog. The catalog should now display the actual product data, as follows:
Bind the ThumbnailView component to the data
After binding the GridView component to the data, you bind the ThumbnailView component.
1.
Open the ThumbnailView.mxml file located in the fbBindings folder.
2.
In Code view, enter the following script block after the opening <mx:VBox> tag to declare a
variable called dataObject:
<mx:Script>
var dataObject;
</mx:Script>
You want to use this variable as a property of the ThumbnailView tag, which you inserted in
the flexstore.mxml file, to pass the catalog model in the flexstore.mxml file to your custom
component.