How often does Event.RENDER get called?
If I added some objects to the Display List via addChild(), how often 开发者_开发技巧does Event.RENDER get fired?
It is called only if you explicitly use stage.invalidate();
You should note that there are certain bugs and special considerations (or at least there were bugs in FP9, which is the last time I actively used stage.invalidate) related to listeners for Event.RENDER.
Regardless of how many different objects listen for Event.RENDER events, if even one of them calls removeEventListener(Event.RENDER... then all listeners are removed. To my knowledge, RENDER is the only event on which this bug occurs (or used to in FP9)
You cannot use stage.invalidate() inside of an Event.RENDER handler. Since you'd only call stage.invalidate in order to trigger the render handler, this should hopefully not be a problem.
EDIT: bigp in the comment below makes a valid observation that Flex may indeed use stage.invalidate under the hood. Take my answer as one that is applicable strictly to vanilla AS3 without any accompanying framework such as Flex.
精彩评论