Sorry to be picky, but any time you have a variable of type :Function, you've lost strong-typing. Events document their parameters and allow more than place to be notified.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Aebig Sent: Tuesday, March 11, 2008 1:37 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: how to call a function in a popup parent? If you're requiring a passed instance and hard-coding the method it calls, than yes, the flexibility is lost. But this method is just a flexible and doesn't require listeners: Component reference var: public var onSubmit:Function; Set the reference: myComponent.onSubmit = myFunction; To trigger inside the component: onSubmit.call(); !k ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Tuesday, March 11, 2008 1:50 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: how to call a function in a popup parent? Glad you got it working, but I vote with Ralf. Having the popup dispatch an event allows for reuse of that popup in other applications and places within the current application. ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Derrick Anderson Sent: Tuesday, March 11, 2008 11:55 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: how to call a function in a popup parent? passing an instance to the parent class as a variable is exactly what i did, thanks guys! On Tue, Mar 11, 2008 at 2:26 PM, actionscript_czar <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Since it looks like MiniTextEditor is a custom component, you could make a public variable, or at least a public setter, inside your component so that a reference is available in your component. Then you would instantiate it like this: textPopUp = new MiniTextEditor(); textPopUp.creator = this; PopUpManager.addPopUp( textPopUp, this ); Then the variable should be available to you. --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Derrick Anderson" <[EMAIL PROTECTED]> wrote: > > hi, > > i create a popup like this from file A: > > textPopUp = > MiniTextEditor( > PopUpManager.createPopUp(this, MiniTextEditor)); > > in this case 'this' is file B: > > from my popup I am trying to call a function in file A, and since the parent > i pass to the popup is not actually the 'parent' - i can't figure out how to > reference a function in the actual parent. any ideas? > > d. >