0

Good day,

Does anyone know if there is a way to determine when all the parts of a SkinnableComponent object have been added? The context of this problem is the following:

I have a custom skinnable component class which needs to update some of its parts (e.g. change some labels) once it has been created, meaning once all the skin parts have been instantiated and added.

Thanks in advance,

Romi Halasz
  • 1,949
  • 1
  • 13
  • 23

1 Answers1

0

The common solution is to override partAdded(partName:String, instance:Object):void and to modify the parts when they are created.

override protected function partAdded(partName:String, instance:Object):void 
{
    super.partAdded(partName, instance);
    if (instance == myLabel)
    {
        myLabel.text = getText();
    }
}
Kodiak
  • 5,978
  • 17
  • 35
  • Thank you very much for the answer. I thought there would be way to determine the skin completion action, through an event or something, but it seems this is the only way. – Romi Halasz Jan 04 '12 at 10:56