Sunday, November 11, 2007

Flex Effect Problem : Check your Alphas

The Flex feature I use less than any other is the Effects. This is because most of the time I am focussed on how the user interacts with the applications data rather than transitioning between states. Part of the reason is that effects are so easy and flexible to use. Infrequent practice means that I forget one really important difference between Flex development and Flash (AS1 or AS2) development : alpha values. In the old days you could set an objects alpha between 0 (invisible) and 100 (opaque). But in AS3 the alpha value can be set between 0 (invisible) and 1 (opaque). Consequently, setting an alpha value of 100 on the alphaTo property of the Fade Effect means you won't get any sort of fade. This has happened to me a few times now and it always results in a short period of intense frustration (an excessive period of time when you consider the scale of the problem) until I remember that I need to use 1 rather than 100.

No comments: