【问题标题】:Interaction between main flex application and component主 flex 应用程序和组件之间的交互
【发布时间】:2011-02-14 08:15:33
【问题描述】:

我为我的 flex 4 应用程序制作了一个登录组件,我从我的主 flex 应用程序中加载了这个组件:

<ns1:Login id="page_login" visible="true"></ns1:Login>

现在我想从登录组件将可见性从 true 更改为 false。有没有办法进行这种互动?

谢谢!

【问题讨论】:

    标签: apache-flex components flex4


    【解决方案1】:

    Login 中,您只需设置visible

    this.visible = false;
    this.includeInLayout = false; // you may want this as well, depending on your ui
    

    在父级中,您可以直接设置visible

    page_login.visible = false;
    

    或者您可以将可见绑定到其他一些属性:

    // in Script
    [Bindable]
    var loginVisible:Boolean = true;
    ...
    // in MXML
    <ns1:Login visible="{loginVisible}" />
    

    【讨论】:

      猜你喜欢
      • 2016-05-15
      • 1970-01-01
      • 1970-01-01
      • 2020-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-15
      相关资源
      最近更新 更多