I have several skin parts defined in a custom component and I want to execute some code after all parts have been added.
Currently, my only idea is to use if statement in overrided partAdded method to test if all parts have been added. Something like this:
ov开发者_运维技巧erride protected function partAdded(partName:String, instance:Object):void
{
super.partAdded(partName, instance);
if (part1 && part2 && part3 && part4) {
some code...
}
}
But, I wonder is there some more elegant solution, some specific method that I could override, or event that I could use for this?
Thanks,
Override attachSkin, and place your code after the call to super.attachSkin().
精彩评论