2 Replies Latest reply on Jan 24, 2011 2:54 AM by Ibarim

    smooth move when position change of hbox children

    Ibarim Level 1

      Hi

      I got a HBox with some children. On user interaction I add and remove children from this HBox. The first child is always added or removed therefore position and index of the rest of children change. I would like to animate this position change, like, when child goes from index 3 (x = 100) to index 2 (x=50) I would like it to

      animate this move. Is this anyhow possible?

       

      I'm aware of autoLayout parameter, I could turn it off and animate position with 'move' effect, but the autoLayout method doesn't apply to adding/removing children.

        • 1. Re: smooth move when position change of hbox children
          Flex harUI Adobe Employee

          States and transitions

          • 2. Re: smooth move when position change of hbox children
            Ibarim Level 1

            I thought about that,but it may not work in my case.

            Let's say I got state 'x' which is a Hbox with 4 children (every child is a Vbox with name and image). Next to the Hbox I got two arrows (left and right). When user click right arrow I remove child 0 and add child at the end of the Hbox. So I go to state 'x+1'. But then user may click the right arrow again and I'd need to go to state 'x+2'. And on the next click 'x+3" and so on.

            Similar with the left arrow:

            When user clicks left arrow I remove 4th child and add child at 0 (I change state from 'x' to 'x-1'). But again after clicking left arrow multiple times I'd need states 'x-2', 'x-3' and so on.

             

            Unless should I create and remove states dynamically?