5 Replies Latest reply on May 28, 2007 6:00 AM by Greg Dove

    Tree icon

    gigisfarleaza Level 1
      How can i change the tree icon with icons from file. I have all the countries flags in a folder and i want to use them as icons in the tree with the countries. I can't import them in the library because they are too big. How can i do this ?

      Please Help
      TKS
        • 1. Re: Tree icon
          Greg Dove Level 4
          Are they gif or jpg images? What do you mean they are too big? Filesize or image size? Either way it makes sense to make them smaller (using image editing software - e.g. fireworks) even if you were to load them in separately at runtime.

          I can't think of an easy way to do what you're asking.
          -You can set the icon as a library symbol for each node in the tree.
          -It would be easy enough to create a library item for the icon to load in external images after it is attached. But in order for this to work, each icon instance in the tree would need to be passed the image URL as a parameter at the attachMovie point inside the component and I can't see an easy way to do that.
          -You have iconFunction and iconField properties inherited from the list class and setIcon method as part of the tree class. But I can't see a way to pass an initialisation object for the icon as it is attached in the tree, which is what you would need.
          Perhaps I have missed something, but I think you might have to (resize them and) put them in the library, and used iconField or iconFunction (I don't know how/if iconField works with an xml dataprovider... I assume it checks an attribute of the node)
          • 2. Re: Tree icon
            gigisfarleaza Level 1
            they are jpg images, to big i mean all together (238 files) - 125 k.

            I know the is no easy way but there must be a way.
            i tried to create a library item for the icon to load in external images after it is attached but i didn't find a way to send the url

            haw about cellrendering ?
            • 3. Re: Tree icon
              Greg Dove Level 4
              Maybe you could do that... but I would be inclined to do try to do it this way:

              import all the images to the library

              download and install this extension
              http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1091 471

              then use it to rename all the symbols and set the linkage IDs. I think using that approach would be quicker. You would use either iconField or iconFunction to set the correct name of the flag. It does mean that the swf is larger and will contain flags that might not be used on occasion. If that's important then I guess your best option would be to work on the cellRenderer approach. I haven't played with it so can't advise how.
              • 4. Re: Tree icon
                gigisfarleaza Level 1
                tks for your help
                • 5. Re: Tree icon
                  Greg Dove Level 4
                  you're welcome, and others may know more about whether/how to do this with a custom cellrenderer