views:

28

answers:

1

I'm using a flex combobox component in Flex builder 3 with sdk 3.4 and I'm trying to use it to expand and select the tree node that the user selected in the combobox component on the change event. However, I'm getting an error when I go to assign the combobox seletedItem to the tree selectedItem. Can you please help? What am I doing wrong?

public function moveSelection(e:Event):void{
deviceSelected = e.currentTarget.selectedItem;
if(deviceSelected != null && deviceSelected.hasOwnProperty(label)){
  Tree.selectedItem = deviceSelected;
  var par:XML = Tree.selectedItem.parent();
  while(par){
    Tree.expandItem(par, true);
    par = par.parent();
  }
}
}