1.

Explain About Component Life Cycle?

Answer»

A set of methods the framework calls to instantiate, control and destroy components. OR The component instantiation LIFE cycle describes the sequence of steps that occur when you create a component OBJECT from a component class. As part of the life cycle, Flex automatically calls component methods, dispatches events, and makes the component visible.

3 Main Phases:

  • BIRTH:Construction, configuration, attachment, initialization
  • LIFE : Invalidation, validation, INTERACTION
  • DEATH : Detachment, garbage collection

override PROTECTED function createChildren():void{
myLab=new Label();
myLab.text="my label";
myLab.setStyle('color',"GREEN");
this.addChild(myLab);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
myLab.move(0,0);
myLab.setActualSize(100,100);
}

A set of methods the framework calls to instantiate, control and destroy components. OR The component instantiation life cycle describes the sequence of steps that occur when you create a component object from a component class. As part of the life cycle, Flex automatically calls component methods, dispatches events, and makes the component visible.

3 Main Phases:

override protected function createChildren():void{
myLab=new Label();
myLab.text="my label";
myLab.setStyle('color',"green");
this.addChild(myLab);
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
myLab.move(0,0);
myLab.setActualSize(100,100);
}



Discussion

No Comment Found