What is the best way to determine if a component in Flex/Flash is showing on the user\'s screen? I\'m looking for an analog to Java\'s Component.isShowing() method.
The
... or avoiding recursion:
public static function isVisible(obj:DisplayObject):Boolean { while (obj && obj.visible && obj !== Application.application) { obj = obj.parent; } return obj && obj.visible; }