开发者

Executing code after all skin parts have been added

开发者 https://www.devze.com 2023-01-12 02:54 出处:网络
I have several skin parts defined in a custom component and I want to execute some code after all parts have been added.

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().

0

精彩评论

暂无评论...
验证码 换一张
取 消