Here is a very simple and useful guide for beginner to follow if you are planning to create custom component in Flex.
It mentions the logic and lifecycle how the flex / flash runs.
http://labs.realeyesmedia.com/labs/downloads/techBriefs/AdvancedCustomComponents_20071102.pdf