Animating children in Flex 4

Does anyone know how to animate the size / position of child layout elements in Flex 4?

Example:

I have a custom layout list component. I want, when I change the positions of children, I want them to animate their movement to new positions.

+1
source share
2 answers

There are currently no built-in methods and plans for creating animated layouts in Flex 4: /.

, , "setLayoutBoundsPosition" "setLayoutBoundsSize" . "" " " , , . , ( , / ), . , , ( , Tweener/Tweenmax, , "setActualSize" "setLayoutBoundsSize" ..).

TweenMax , , . TweenMax 3 (20 7fps), Spark Effects, . , updateDisplayList .

TweenMax.to(child, duration, {setLayoutBoundsPosition:{x:childX * i, y:childY * i}});

+1

BUMP.

...

public override function updateDisplayList(width:Number, height:Number) : void {
    for (var i:uint = 0; i < target.numElements; i++)
    { 
       var resizeElement:Resize = new Resize(target.getElementAt(i) as IVisualElement);
       resizeElement.widthTo = 500;
       resizeElement.play();
    }
}
0

All Articles