for posterity, I finally came up with a decent solution.

To programatically deselect an item from a Tree:

treeObjectName.selectedItem = null;

Hope that helps somebody at some point.

H


--- In flexcoders@yahoogroups.com, "hardaur55" <[EMAIL PROTECTED]> wrote:
>
> Good morning all,
> 
> I'm trying to set up a tree control so that branch items open and close
> on select just as if somebody had clicked the twirly.
> 
> I've got everything taken care of but I need to find a way to
> programatically deselect the branch item.
> 
> Here's the code problem:
> 
> In my Tree change event handler
> 
> public function handleTreeChangeEvent(event:Event):void
> {
>          //some code
> 
> if (selectedVideoId != '')
>      {
>          trace(selectedVideoId + " is the selected video");
>      }
>      else
>      {
>          if (videoTree.isItemOpen(selectedVideo))
>          {
>              videoTree.expandItem(selectedVideo, false, true);
>              //**** I now need to deselect this tree item
>          }
>          else
>          {
>              videoTree.expandItem(selectedVideo, true, true);
>              //****  I now need to deselect this tree item.
>          }
>      }
> }
> 
> See the //**** comments for details on what I'm trying to do.
> 
> I very much appreciate any light anybody can shine on this, I've been
> beating up google and the API docs for the last few hours with no
> results.
> 
> Thanks!!
> 
> H
>


Reply via email to