1 Reply Latest reply on Jul 9, 2006 7:51 PM by inlineblue

    use combobox to select viewstack content

    Thijs
      How can I slect the content of a viewstack with a combobox?



      I tried

      viewstack.selectedChild=combobox.selectedItem.stack

      where stack is a variable of the selected combobox item.

      Alert.show(combobox.selectedItem.stack)

      works fine, but I cant use the variable stack to point at a canvas within the viewstack.

      Thanks
        • 1. Re: use combobox to select viewstack content
          inlineblue Level 1
          There're only two ways to select a child of a ViewStack, either through selectedChild or selectedIndex. You have to store one of them with the ComboBox item. Why can't you use the variable "stack" to point to the child Canvas? Whenever you add a child to the ViewStack, just keep a reference to the child using the "stack" variable before adding the item to the ComboBox.