Yes, something else is going on here.  I do this regularly in a Login
popup where I pre-set the User Id from a value in a SharedObject.

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Saturday, November 10, 2007 8:20 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: How to call methods on popupwindow after
its PopUpManager.centerPopUp is called

 

Was someElement actually invisible and did not become visible?  Did you
debug into the call?  I would expect that to work.

 

In the event example, you dispatched off of Application, but listened
from the PopUp.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of j301c
Sent: Saturday, November 10, 2007 8:56 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How to call methods on popupwindow after its
PopUpManager.centerPopUp is called

 

That would make sense and I really wish it worked that way, however, 
that is not the case. Here is a short code example. 

in CustomTitleWindow.mxml...

public function doSomething():void {
this.someElement.visible = true;
}

in Application.mxml...

function callFunctionAfterCenterPopUp() {
//create popup, cast to CustomTitleWindow
cTitleWindow = CustomTitleWidnow(PopUpManager.createPopUp
(this,CustomTitleWindow,false));
//center popup
PopUpManager.centerPopUp(cTitleWindow);
//call method within CustomTitleWindow class on popupwindow reference
cTitleWindow.doSomething();//nothing happens
}

It also seems that events do not bubble over to pop-up windows. 

in CustomTitleWindow.mxml...

//called on creation complete
public function init():void {
this.addEventListener("somethingHappened", doSomething);
}

in Application.mxml...

//called when a button is clicked for example
public function causeEvent():void {
dispatchEvent(new Event("somethingHappened", true, false));
}

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Yes, you can call methods on your popup at any time. Just hang on 
to a
> reference to it and call as needed.
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of j301c
> Sent: Friday, November 09, 2007 6:26 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] How to call methods on popupwindow after its
> PopUpManager.centerPopUp is called
> 
> 
> 
> I have a popupwindow that should display information about and item 
> selected from a datagrid on the main application. I have found 
> examples where you can pass data to the popupwindow before 
centerPopUp 
> is called. Is it possible to call methods, or pass data for that 
> matter, on that popupwindow instance after centerPopUp is called?
>

 

Reply via email to