The following example shows how you can control whether the Adobe AIR FileSystemTree control displays only files, only subdirectories, or both by setting the enumerationMode property to one of the static constants in the FileSystemEnumerationMode class.

Full code after the jump.

Download FileSystemTree_enumerationMode_test.zip

The following example filters the items in the FileSystemTree control so only directories are visible by setting the enumerationMode property to "directoriesOnly" (FileSystemEnumerationMode.DIRECTORIES_ONLY):





    


The following example lets user’s control how files and directories are displayed by changing the enumerationMode property dynamically using a ComboBox control:





    
        

    
        
            
                
                    
                        
                            {FileSystemEnumerationMode.DIRECTORIES_FIRST}
                            {FileSystemEnumerationMode.DIRECTORIES_ONLY}
                            {FileSystemEnumerationMode.FILES_AND_DIRECTORIES}
                            {FileSystemEnumerationMode.FILES_FIRST}
                            {FileSystemEnumerationMode.FILES_ONLY}
                        
                    
                
            
        
    

    


Due to popular demand, here is the “same” example in a more ActionScript friendly format:





    
        


3 Responses to Toggling file and folder visibility on a FileSystemTree control in Adobe AIR

  1. comet says:

    Thanks!!

  2. Asyou says:

    Goog Examples! Thanks

  3. Hashim says:

    Thanx it really helped me :)

Leave a Reply

Your email address will not be published.