How to set a DataProvider to Tree in FLEX

A simple way to build a data provider for a flex tree is to use XMLList

This simple application will use XMLList to populate the data provider of the FLEX Tree.

Note that the dataProvider is assigned the id of the XMLList item. In order for the tree to "know" what to show for the nodes label the labelField property is set to "@label" meaning that the label of the tree node will be taken from the label property in the xml nodes


<?xml version="1.0" encoding="utf-8"?>