2 Replies Latest reply on Nov 24, 2008 4:16 AM by luminatingsky

    How to Create a SIMPLE Flex Tree?


      Okay Im pretty new to flex and i have a uni assignment where i need to use it.

      A tree list would be perfect for one part of the site, otherwise it would have heaps and heaps of links.

      I want a tree that has four clickable parents (nodes) and then inside each parent i want 14 leafs. When a leaf is clicked on i want an image and some text to appear next to it.

      Similar to the tree example in the Adobe Flex Explorer - http://examples.adobe.com/flex3/componentexplorer/explorer.html

      While i can figure out how they are creating the tree, and naming the nodes etc, i don't' know how to edit it to display and image and content into the right side box?

      If someone could tell me, explain it, or has source code to a simple example that would be awesome!

      Thanks in advance,

        • 1. Re: How to Create a SIMPLE Flex Tree?
          SujitG Level 2

          In the sample you have the treeChanged function which is getting invoked when user selection in the tree changes right. You will have to display the Image and content in this function. You will have to create a container with Image and Text control on the right and keep changing the source and text property of the Image and Text control respectively in the change handler function.

          Hope this helps.
          • 2. Re: How to Create a SIMPLE Flex Tree?
            luminatingsky Level 1
            hey thanks for replying. i eventually found a tute of what i wanted and got it all working. didn't realize how easy xml is lol ^-^

            would you be able to help me with something else though? i posted another topic just above.

            what i want to do (this is separate form the tree) is have one image and when i click on it have it change to another image.

            essentially it will be the back of a playing card and then when it's clicked on it will swap to the front of the image card. so i have a back image and a front image. how can i swap them?