Flex Custom Component Lifecycle

-

Wednesday, January 21st, 2009

The purpose of this post is to identify what the component lifecycle is and how to utilize it to create components that are efficient and re-usable. I will cover both the functions we need to override as well as the events that are dispatched along the way.

First, let’s start with a quiz.

1. True or False. I know what the lifecycle functions: createChildren(), commitProperties(), measure(), and updateDisplayList() are and I use them often in my custom component development.
2. True or False. I know what circumstances are appropriate for overriding commitProperties(), measure(), and updateDisplayList().
3. True or False. I know what deferred validation is and how it is used in the component lifecycle.
4. True or False. I know when the preinitialize, initialize, creationComplete, and updateComplete are dispatched relative to createChildren(), commitProperties(), measure(), and updateDisplayList().

If you answered false to any of the above questions, I will cover the answers next. So keep reading :) .

(more…)