Thanks everybody. all you guys are awesome.

I was able to control the click events from my main application and 
was able to change the state of my main application pretty straight 
forward.

I very much followed this example from Abode and is the same as what 
bailey explained.

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhel
p.htm?context=LiveDocs_Parts&file=00000701.html


yet again will all the interesting issues!....
this is possible if the popup(TitleWindow) is from the same .swf, but 
what if the popup window was a different .swf (i mean by saying a 
different 'html' pop up window and the .swf sitting inside it).
Is there anything similar to addEventListener that I could use?

Scenario 1:(mainApp.mxml, popUp.mxml, mainApp.swf)
Scenario 2:(mainApp.mxml, popUp.mxml, mainApp.swf, popUp.swf)

--- In [email protected], Bailey <[EMAIL PROTECTED]> wrote:
>
> 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 [email protected] <flexcoders%40yahoogroups.com>, 
Bjorn
> > Schultheiss
> >
> > <bjorn.mailinglists@> 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