代码之家  ›  专栏  ›  技术社区  ›  Tam

什么是灵活的良好实践来改变另一个组件的状态?

  •  1
  • Tam  · 技术社区  · 15 年前

    我目前使用:flexglobals.toplevellapplication.component1.component2.currentState='something';

    有更好的方法吗?我可以将组件的状态绑定到我的模型中的变量吗?

    2 回复  |  直到 15 年前
        1
  •  3
  •   JeffryHouser    15 年前

    [Bindable]
    public var comp1State : String = 'defaultState';
    

    <mx:Container currentState="{model.comp1State}" otherComponentProperties>
     <!-- other component code including defining the states -->
    </mx:Container>
    

    model.comp1State = 'nextState'
    

        2
  •  0
  •   Tjelle    15 年前
    推荐文章