2 Replies Latest reply on Aug 18, 2006 2:07 PM by deepa subramaniam (adobe)

    Regression with tree.iconFunction: default icons have disapperead

      I have a tree control, with icon function redifined.
      However, for some items, I would like to use default tree icons (folder, sheet,...)
      In Flex 1.5, if returned null from the iconFunction, the default icon was displayed.
      In Flex 2.0, this does not work anymore. The doc says that the icons are in Assets.swf, but how to reference and embed them in my application ?
        • 1. Re: Regression with tree.iconFunction: default icons have disapperead
          Here's a code snippet of one way to set Tree's icons:

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" width="600" height="600">
          public var redU:Class;

          public var treeArray:Object =
          { label:"Containers", children:
          { label:"DividedBoxClasses", children:
          { label:"BoxDivider", data:"BoxDivider.as" }
          { label:"GridClasses", children:

          { label:"GridRow", data:"GridRow.as" },
          { label:"GridItem", data:"GridItem.as" }



          { label:"Printing", children:
          { label:"PrintJob", data:"PrintJob.as"},
          { label:"PrintJob1", data:"PrintJob1.as" },
          { label:"PrintDataGrid", data:"PrintDataGrid.as" }

          <mx:Tree dataProvider="{treeArray}" disclosureClosedIcon="{redU}" />


          There's a a style property mapping to each Tree icon (ex: folderOpenIcon, defaultLeafIcon).

          Hope that helps,
          • 2. Re: Regression with tree.iconFunction: default icons have disapperead
            deepa subramaniam (adobe)
            The default icons for Tree are indeed embedded in Assets.swf. You can find out the names of the symbols in defaults.css by checking the Tree type selector entries.

            defaultLeafIcon: Embed(source="Assets.swf",symbol="TreeNodeIcon");
            disclosureClosedIcon: Embed(source="Assets.swf",symbol="TreeDisclosureClosed");
            disclosureOpenIcon: Embed(source="Assets.swf",symbol="TreeDisclosureOpen");
            folderClosedIcon: Embed(source="Assets.swf",symbol="TreeFolderClosed");
            folderOpenIcon: Embed(source="Assets.swf",symbol="TreeFolderOpen");