As the matter of fact I just forgot to say that for focusInHandler to work
your component has to implement IFocusManagerComponent. In this way you
don't have to add these methods as event listeners manually.

And as to relatedObject part of understanding came from documentation and
another one came from reading sdk sources.

R.

On 2/2/07, zhongtie <[EMAIL PROTECTED]> wrote:

  Thanks, Roman. Actually you answered my another question: I have been
trying to figure out why I cannot focus in the edit control inside the
titlewindow :) Where did you learn those good tips about relatedObject ?!!

I am still a little puzzled by how focusIn works. I realized I have to
do these two lines before the focusIn/OutHandler gets invoked:

this.addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
this.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);

Does it mean by default, TitleWindow doesn't get FOCUS events
dispatched to?

Thanks again for your great help!

Tim

--- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Roman
Protsiuk"
<[EMAIL PROTECTED]> wrote:
>
> Overloading focusOutHandler/focusInHandler helps. You'll be able to
handle
> FocusEvents there.
> Like in
>
>
> protected override function focusOutHandler(event : FocusEvent) : void {
> if (event.relatedObject == null || !contains(event.relatedObject)) {
> // event came from "outside" not from one of the children
> }
> super.focusOutHandler(event);
> }
>
> R.
>
> On 2/2/07, zhongtie <[EMAIL PROTECTED]> wrote:
> >
> > I pop up TitleWindows using PopupManager, and I change the titlebar
> > colors based on if the titleWindow is active (topmost) or not. The
> > problem is, I am NOT able to capture the focus event for TitleWindow
> > (other controls, like TextArea, has no problems), nor does
> > onFocusIn/onFocusOut overwrite work.
> >
> > Any idea?
> >
> >
> >
>

Reply via email to