Hi Kal,
I believe BJorn is talking about listening within your flex application for
the closeEvent generated from your popup window upon the event.
When your listener picks up the closeEvent,
within your mxml application you may make your function call to do your
state changing work

For Example:

<mx:Script>
<![CDATA[
import mx.managers.PopUpManager
import mx.containers.TitleWindow;
import mx.events.CloseEvent;


private var myWindow:TitleWindow;

private function showWindow(event:Event):void {
myWindow = TitleWindow(PopUpManager.createPopUp(this, TitleWindow));
myWindow.addEventListener(CloseEvent.CLOSE, closeHandler);
myWindow.showCloseButton = true;

}
private function closeHandler(event:CloseEvent):void
{
    //do your application state changing
}
]]>
</mx:Script>


This creates a popup window instance, and then assigns a event listener to
actively listen for that specific closeEvent..
When it detects the event occurred it will execute the closeHandler
function, which you can control to do your bidding..

You probably won't be wanting to create your initial popup from within flex
actionscript anyways...
hopefully this helps some

On 10/28/07, kalpkat9 <[EMAIL PROTECTED]> wrote:
>
>   Thanks for taking your time to respond, Bjorn.
>
> I am triggering a function called submitData() from the click event of
> my button inside the popup window.
>
> private function submitData():void{
> mainApp.currentState.name = "secondState";
> }
>
> This doesnt seem to accomplish what I wish for (of changing the state
> of my mainApp.mxml)
>
> How is that I can access a function from my main application mxml,
> for example: changeState().
>
> private function changeState():void{
> currentState = "secondState";
> }
>
> Please excuse my ignorance. Could you let me know what I am missing?
>
> Thank you.
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, Bjorn
> Schultheiss
>
> <[EMAIL PROTECTED]> wrote:
> >
> > Listen to the closeEvent from the popup and call the function from
> > the handler.
> >
> > Bjorn
> >
> >
> > On 29/10/2007, at 12:10 PM, kalpkat9 wrote:
> >
> > > Hi,
> > >
> > > This might be a really petty question to ask, but I will greatly
> > > appreciate if someone can answer.
> > >
> > > How can I trigger a function in my main application mxml, from a popup
> > > window(title window/panel) after a submit button click. (I am
> > > trying to
> > > change the state of my main application by clicking the submit button)
> > >
> > > Thank you,
> > > Kal.
> > >
> > >
> > >
> >
>
>  
>

Reply via email to