I am not sure how familiar you are with MVC but you might wanna take a
look at using an application model to store string data. Normally, a
popup will have content specific strings such as prompts for
comboboxes and the title of the popup that it and only it should know
or be concerned about.
But assume for the second that your popup is a change password popup
right? It would need to know a few things about your username and old
password to display and compare against. You don't really want the
view that created this popup to have to know about what to put inside
it to display regarding those properties. Instead, you would have
properties on the model somewhere called userName, password. Since
the model should be a singleton, then you can have the popup get the
instance of the model and grab those properties via binding {}.
So you textInput inside your popup has no need to communicate with the
view that created it, not does that view need to know anything about
the popup. The popup looks to the model for information.
That is a rather lengthy response to a simple question but I think it
will lead you to a more clean implementation.
--- In [email protected], [EMAIL PROTECTED] wrote:
>
> Hello All ----
>
> I have been using Flash and AS3 for some time now, however I am new
to Flex (and this group) and looking forward to seeing all that it can
do. I have come across a situation which I believe to be rather
simple to resolve, yet I have been unable to do so. I have my
Application file which is calling a PopUp Component created with a
> TitleWindow Component. I have a button in the Application file that
> when it's clicked will open the PopUpComponent. How can I pass a
> variable/parameter from the Application to the TitleWindow for the
> text . Here's the code I am using in Application:
>
> ------------------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
>
> <mx:Script>
> <![CDATA[
>
> import dialogue.SimpleDialogue;
> import mx.managers.PopUpManager
> import mx.containers.TitleWindow;
>
> private var myPopUp:TitleWindow
>
> private function showPopUp():void
>
> myPopUp =
PopUpManager.createPopUp(this,dialogue.SimpleDialogue,true) as
TitleWindow;
> PopUpManager.centerPopUp(myPopUp)
> }
> ]]>
> </mx:Script>
>
> <mx:Button label="Show Popup Dialogue" click="showPopUp()"></mx:Button>
> </mx:Application>
>
--------------------------------------------------------------------------
>
> And here's the code in the Component:
> ---------------------------------------------
> //SimpleDialogue Component
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <mx:Label id="message" text="" fontSize="24">
>
> </mx:Label>
>
> </mx:TitleWindow>
> -----------------------------------------------------------
>
> Hopefully, this makes sense. If not, I would be happy to clarify.
Thanks for any and all replies.
>
> SL
>