views:

92

answers:

1

Hello everybody.

I made a login component for my flex 4 application, and i 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!

+1  A: 

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}" />
Michael Brewer-Davis
thank you very much!
Tom