3 Replies Latest reply on Jan 29, 2009 11:23 AM by Newsgroup_User

    Tree control w/ custom objects...

    peteandrus Level 1
      I have a Tree control in which i put custom objects. It works well, but now i want to start adding custom icons, or removing the icons altogether, for it's nodes. How do i do this? Do i need to add some property to my custom object nodes? I appreciate any info!
        • 1. Re: Tree control w/ custom objects...
          Level 7

          "peteandrus" <webforumsuser@macromedia.com> wrote in message
          news:glo5am$mif$1@forums.macromedia.com...
          >I have a Tree control in which i put custom objects. It works well, but now
          >i
          > want to start adding custom icons, or removing the icons altogether, for
          > it's
          > nodes. How do i do this? Do i need to add some property to my custom
          > object
          > nodes? I appreciate any info!

          I think you can just use an iconFunction.


          • 2. Re: Tree control w/ custom objects...
            peteandrus Level 1
            i am mostly concerned, for now, about having no icon. I tried passing 'null' back from my iconFunction, but it blew up on me. Any suggestions about how to go about this? thanks
            • 3. Re: Tree control w/ custom objects...
              Level 7

              "peteandrus" <webforumsuser@macromedia.com> wrote in message
              news:glsu6c$pfm$1@forums.macromedia.com...
              >i am mostly concerned, for now, about having no icon. I tried passing
              >'null' back from my iconFunction, but it blew up on me. Any suggestions
              >about how to go about this? thanks

              try this (pseudocode, not tested)

              //this is a 1 px transparent png
              [Embed ('images/icons/nullIcon.png')]
              private var nullIcon:Class;

              [Embed ('images/icons/yourIcon.png')]
              private var yourIcon:Class;

              private function setIcon(data:Object):Class {
              if (data.something) {
              return yourIcon;
              }
              return nullIcon;
              }

              HTH;

              Amy