Archive for July, 2011

Pitfall when using Resize effect in Flex.

I recently tried to use the Resize effect to animate the width of a component inside an HGroup. The height should remain fixed to 100%. But after using the effect once, the height never updated itself to the height of the HGroup.

I guess the reason is that the Resize effect always updates both width and height, even if you specify just one of the two dimensions. So when the Resize ends, not only the width has changed, but also the height, i.e. it no longer contains the value NaN.

I fixed this by using AnimateProperty, so I could animate just the width and leave the height to NaN and the percentHeight to 100;

No Comments