Adobe Air - 如何在显示对话框时使背景变暗(标题 window)

Adobe Air - How to dim background when displaying a dialog (title window)

假设我有以下 mxml:

<view...>

  <s:VGroup width="100%" height="100%">
      <s:Button label="some label"/>
      <s:Button label="some other label"/>
      <s:Button label="yet another label"/>
      <s:Button label="one last label"/>
  </s:VGroup>

  <s:TitleWindow includeIn="abandon" id="dlgAbandon" title="Question">
        <s:VGroup horizontalAlign="center" paddingTop="8" paddingBottom="8" paddingLeft="20" paddingRight="20" gap="10" width="100%" height="100%">
            <s:Label text="Why?" color="{Constants.ChromeColor}" fontWeight="bold"/>
            <s:VGroup width="100%" gap="10">
                <s:Button label="reason 1" width="100%" id="btnR1"  click="onDlgWhyNotClose('reason 1')"/>
                <s:Button label="reason 2" width="100%" id="btnR1"  click="onDlgWhyNotClose('reason 2')"/>
                <s:Button label="reason 3" width="100%" id="btnR1"  click="onDlgWhyNotClose('reason 3')"/>
            </s:VGroup>
        </s:VGroup>
    </s:TitleWindow>

</view>

现在,在我的代码中,我将 currentState 更改为 "abandon",以便对话框显示在 VGroup 的顶部。

如何调暗对话框背后的背景(VGroup 中的所有内容甚至其 parent - 视图)?当对话框关闭时我如何取消它?

谢谢 :-)

阿维

一个快速的解决方案是为此状态添加半透明背景,例如

<view...>

<s:VGroup width="100%" height="100%">
  <s:Button label="some label"/>
  <s:Button label="some other label"/>
  <s:Button label="yet another label"/>
  <s:Button label="one last label"/>
</s:VGroup>

<s:SkinnableContainer includeIn="abandon" 
                      width="100%"
                      height="100%"
                      backgroundColor="#000000"
                      backgroundAlpha="0.3">

    <s:TitleWindow id="dlgAbandon" title="Question">
        <s:VGroup horizontalAlign="center" paddingTop="8" paddingBottom="8" paddingLeft="20" paddingRight="20" gap="10" width="100%" height="100%">
        <s:Label text="Why?" color="{Constants.ChromeColor}" fontWeight="bold"/>
            <s:VGroup width="100%" gap="10">
                <s:Button label="reason 1" width="100%" id="btnR1"  click="onDlgWhyNotClose('reason 1')"/>
                <s:Button label="reason 2" width="100%" id="btnR1"  click="onDlgWhyNotClose('reason 2')"/>
                <s:Button label="reason 3" width="100%" id="btnR1"  click="onDlgWhyNotClose('reason 3')"/>
            </s:VGroup>
        </s:VGroup>
    </s:TitleWindow>

</s:SkinnableContainer>

</view>

请注意,现在 SkinnableContainer 包含在放弃状态中,而不仅仅是 TitleWindow