开发者

Interaction between main flex application and component

I made a login component for my flex 4 application, and 开发者_如何学Pythoni load this component from my main flex application with:

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

Now i want to change the visibility from true to false, from the login component. Is there a way to do this kind of interaction?

Thanx!


From within Login, you'd just set visible:

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

From within the parent, you could set visible directly:

page_login.visible = false;

or you could bind visible to some other property:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜