On 2/1/08, Daniel Poon <[EMAIL PROTECTED]> wrote:
> I learnt how to make a component in a separate file e.g.
> component.mxml, but I am having problem with passing variables back to
> the main.mxml.
>
> If I have a login TitleWindow for the component.mxml, once the user
> input userID password, how do I pass this back to the main.mxml?
[snip]
This is one of the patterns I follow.
<!-- component.mxml -->
<TitleWindow>
private function save()
{
data.userID = userIDTextInput.userID;
data.password = passwordTextInput.password;
}
private function close()
{
PopUpManager.removePopUp(this);
dispatchEvent(new Event(Event.CLOSE));
}
</TitleWindow>
>From your OK button you call save() and close(). The application
handles the close event and gets the data from the data property of
the component.
Manish