I finally figured it out!

When you press on an element in a component you don't call setFocus,
but pressFocus() instead! And don't forget the releaseFocus() as well.
This sets a fake focus on component and a true focus on the element so
that you're still able to interact with the element.

Man that was a tough problem with almost no information about it anywhere.
If anyone is looking for more info on the subject, see UIComponent's methods:

. setFocus()
. getFocus()
. pressFocus()
. releaseFocus()
. onSetFocus(oldFocus)
. onKillFocus(newFocus)

2007/8/22, Bart Wttewaall <[EMAIL PROTECTED]>:
> Well, I'd be truly surprised if that would work, but I'l try tomorrow
> when I'm at work again :)
> Thanks for the tip.
>
> Bart
>
> 2007/8/21, John laPlante <[EMAIL PROTECTED]>:
> > Go ahead and try that and I bet it will work.
> >
> > Bart Wttewaall wrote:
> > > Thanks for replying John,
> > >
> > > But no, I never use _root, nor _level.
> > > I'm calling this from a clickHandler within my component's class.
> > > Like this (pseudocode):
> > >
> > > class Joystick extends UIComponent {
> > >
> > > ...
> > >
> > > public function init() {
> > > ...
> > > tabEnabled = true;
> > > tabChildren = false;
> > > ...
> > > }
> > >
> > > private function onRelease() {
> > > getFocusManager().setFocus(this);
> > > }
> > >
> > > }
> > >
> > > 2007/8/21, John laPlante <[EMAIL PROTECTED]>:
> > >
> > >> Are you using calling this relative to _root or _level0?
> > >> _root.focusManager.setFocus
> > >>
> > >> Bart Wttewaall wrote:
> > >>
> > >>> Hi list,
> > >>>
> > >>> I'm having trouble with the focusmanager. I created a Joystick
> > >>> component that should be able to receive focus using the tab-key
> > >>> (tabIndex) or by clicking it.
> > >>>
> > >>> Since it extends UIComponent, implementing the tabIndex version is
> > >>> easy; at init, set tabEnabled to true and tabChildren to false.
> > >>>
> > >>> Now when the user clicks the component, it should also receive focus.
> > >>> I've tried to call setFocus(this) or getFocusManager().setFocus(), but
> > >>> the result is no focus, and worse, the joystick element with which you
> > >>> control the component stops functioning as if the mouse is ignored.
> > >>>
> > >>> Does anyone have an example or a good source about the FocusManager?
> > >>> Thanks in advance.
> > >>>
> > >>> Bart Wttewaall
> > >>> _______________________________________________
> > >>> Flashcoders@chattyfig.figleaf.com
> > >>> To change your subscription options or search the archive:
> > >>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > >>>
> > >>> Brought to you by Fig Leaf Software
> > >>> Premier Authorized Adobe Consulting and Training
> > >>> http://www.figleaf.com
> > >>> http://training.figleaf.com
> > >>>
> > >>>
> > >>>
> > >> _______________________________________________
> > >> Flashcoders@chattyfig.figleaf.com
> > >> To change your subscription options or search the archive:
> > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > >>
> > >> Brought to you by Fig Leaf Software
> > >> Premier Authorized Adobe Consulting and Training
> > >> http://www.figleaf.com
> > >> http://training.figleaf.com
> > >>
> > >>
> > > _______________________________________________
> > > Flashcoders@chattyfig.figleaf.com
> > > To change your subscription options or search the archive:
> > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> > >
> > > Brought to you by Fig Leaf Software
> > > Premier Authorized Adobe Consulting and Training
> > > http://www.figleaf.com
> > > http://training.figleaf.com
> > >
> > >
> > _______________________________________________
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to