From 5de8a3acf7aeb5e012eae5a0e0d024fcc4edc311 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 8 Aug 2008 23:11:16 +0000 Subject: [PATCH] Added this, since we do it lots of places and it often looks like an error. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@617 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flex/FlexUtil.as | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/as/com/threerings/flex/FlexUtil.as b/src/as/com/threerings/flex/FlexUtil.as index 383610b3..36f55d2b 100644 --- a/src/as/com/threerings/flex/FlexUtil.as +++ b/src/as/com/threerings/flex/FlexUtil.as @@ -24,6 +24,8 @@ package com.threerings.flex { import mx.controls.Label; import mx.controls.Spacer; +import mx.core.UIComponent; + /** * Flex-related utility methods. */ @@ -52,5 +54,16 @@ public class FlexUtil spacer.height = height; return spacer; } + + /** + * In flex the 'visible' property controls visibility separate from whether + * the component takes up space in the layout, which is controlled by 'includeInLayout'. + * We usually want to set them together, so this does that for us. + */ + public static function setVisible (component :UIComponent, visible :Boolean) :void + { + component.visible = visible; + component.includeInLayout = visible; + } } }