Here I am going to explain how we can build a dynamic tree using FTree Component that comes with Flash UI Components Set 2.

Hierarchical nature of XML makes it more suitable for building Tree Views But I have decided to use simple tab file (Tab delimited text file) which contains the path to build the tree like “root/branch/branchof the branch” and the URL in each line.
Take a look at the text file which I used to build the tree below.

Note: My Inspirations is a long list I’ve mentioned only few here to keep this example simple 🙂

To implement my code in your projects just follow the instructions below

  • Step 1. Preparing the file:
    • Create a new flash movie and drag and drop FTree Component from the components window, resize it to fit your needs.
    • Name the instance as “my_tree”
  • Step 2. Preparing the data:
    • Copy the file sample tab file from here to the same folder
      [or]
    • Create a new text file in the same folder and name it as “TreeData.txt
    • type the tree path like “my root/my folder/my subfolder” followed by minimum one tab then type the URL
      (you can use as many tabs as you want to keep them like colums in your text editer)
    • repeat this step until you finish all the items
  • Step 3. Adding the code:
    • Download my code from here and copy paste it into the first frame of your flash file
    • Modify it to suit your needs
    • Publish and have fun 🙂