| Adobe AIR 1.1 |
|
|
FileSystemTree controlA FileSystemTree control displays the contents of a file system directory as a tree. The tree can display the directory’s files, its subdirectories, or both. For files, file names can be displayed with or without extensions. For more information on the FileSystemTree control, see the Flex 3 Language Reference. Creating a FileSystemTree controlYou use the <mx:FileSystemComboBox> tag to define a FileSystemComboBox control in MXML, as the following example shows. Specify an id value if you intend to refer to a component elsewhere in your MXML, either in another tag or in an ActionScript block. You specify the currently displayed directory using the control’s directory property. You can set the directory property in MXML by binding the value to a property or variable, or by setting the property in ActionScript. When you set the directory property, the data provider of the underlying tree control is automatically populated. The specified directory isn’t displayed in the tree—its child files or directories are shown as the top-level nodes of the tree. By default the directory property is set to the root “Computer” directory. Consequently, its children (the drive or drives attached to the computer) are displayed as the top branches of the tree. The following example demonstrates creating a FileSystemTree control that displays all files and folders, which is the default. In addition, hidden files are shown by setting the showHidden property to true. <?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:FileSystemTree showHidden="true"/>
</mx:WindowedApplication>
FileSystemTree user interactionThe FileSystemTree control supports the same types of user
interaction as the standard Flex Tree control. In addition, the FileSystemTree control provides several additional events for file-related functionality. If the user double-clicks
a closed directory node or clicks its disclosure icon, the control
dispatches a directoryOpening event. If the user
double-clicks an open directory node or clicks its disclosure icon,
the control dispatches a directoryClosing event.
If the user double-clicks a file node, the control dispatches a fileChoose event. <Oct 31, 2008 - corrected event name to |