tags:

views:

50

answers:

1

1) preInitialize: This event is raised when the component has just been created but none of the child components exist.

2) initialize: This event is raised after the component and all its children have been created but before any dimensions have been calculated.

3) creationComplete: This even is dispatched after all the component and its children have been created and after all the layout calculations have been performed.

4) applicationComplete: Dispatched after all the components of an application have been successfully created

My Questions Here

  1. Lets suppose i create a button component, what are the child components then? Can anyone explain me in depth on the Child components of a component.

  2. Can anyone show me an example of code, where a component is a created.. i mean a custom component from scratch.

+1  A: 

The Flex SDK source code is your friend. View it here:

http://opensource.adobe.com/svn/opensource/flex/sdk/tags/3.5.0.12683/frameworks/projects/framework/src

(You can also access the source code to any framework class by pressing CTRL-SHIFT-T in Flash Builder and then typing the name of the framework component you want to open).

  1. Take a look at mx.controls.ComboBase which is the superclass of mx.controls.ComboBox. Its createChildren() method create several children, including a border, arrow button and text input. The dropdown (which shows the item in ComboBox.dataProvider) is defined in ComboBox and created / destroyed dynamically, so it is not created in createChildren.

  2. Any of the classes here make good examples, although sometimes the implementation could be cleaner. Simple components like Button, CheckBox and RadioButton are a good place to start.

cliff.meyers
Thanks... pretty clear explantion... can u show me an example if possible, very basic one where we extend a component and create our own component... i mean the steps and code...