3 Replies Latest reply on Feb 7, 2008 3:07 PM by Arty13

    Custom Tree DataDescriptor help?

      I created a custom Tree DataDescriptor, it is working as expected, but in the DataDescriptor, I also added extra function for my needs.
      Within the Flex tool, I assign the custom DataDescriptor to my generic tree. But within ActionScript, when I try to use my customDataDescriptor with its custom function it thinks it is looking at the default ITreeDataDescriptor so Flex gives me an error saying

      "1061: Call to a possibly undefined method getLeafNodes through a reference with static type mx.controls.treeClasses:ITreeDataDescriptor."

      getLeafNodes is one of my custom functions I have in my new DataDescriptor. I know the tree is using my custom DataDescriptor correctly when i'm not using my custom functions.

      When I call my custom function, I am doing this...


      I get an error doing this, but if I create a custom DataDescriptor Object and call my functions directly that way it sees it,
      for example...

      var myDataDescriptor:CustomTreeDataDescriptor = new CustomTreeDataDescriptor();
      myTree.dataDescriptor = myDataDescriptor;


      I dont want to call the function directly but want to do this -> myTree.dataDescriptor.getLeafNodes()

      Any ideas to have it work like I want it too? (without having to create a custom tree)