Alex is, of course, correct. Listening for MouseEvent.CLICK on your TabNav
in the capture phase and calling event.stopImmediatePropagation() in the
handler will prevent switching to the new tab. (mouseDown didn't seem to
work) One thing to remember though is that since you're listening to the
capture phase your handler will get called twice for each click. Once during
capture phase and again in the bubble phase.

HTH,
Ben



On Wed, Apr 2, 2008 at 12:14 AM, Alex Harui <[EMAIL PROTECTED]> wrote:

>    I helped an co-worker block List selection by picking off mouseDown in
> capture phase and calling stopImmediatePropagation().  You might be able to
> do the same for TabNav.  You might have to get the click event instead and
> check to see if the target is one of the Tabs.
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *ben.clinkinbeard
> *Sent:* Tuesday, April 01, 2008 8:08 PM
> *To:* [email protected]
> *Subject:* [flexcoders] Re: TabContainer with modules - how to cancel Tab
> change
>
>
>
> Unfortunately, I believe this is the best you can do:
>
> http://tech.groups.yahoo.com/group/flexcoders/message/84929
>
> HTH,
> Ben
>
> --- In [email protected] <flexcoders%40yahoogroups.com>,
> "guitarguy555" <[EMAIL PROTECTED]> wrote:
> >
> > I have a Flex Application that has a TabNavigator. Each tab contains a
> > moduleLoader that loads a corresponding Module.
> >
> > On some of these modules, I have a basic Form with Validators connected
> > to it. I want to be able to make sure that the form values are valid
> > before the user navigates away from the currently selected tab by
> > clicking a new tab.
> >
> > In other words, I want the Validator to fire when the user clicks on a
> > new tab and if there are any invalid values I want to prompt the user
> > to fix them and stop the event propogation so the TabNavigator stays on
> > the current tab.
> >
> > How can I cancel the TabNavigator change?
> >
>
>  
>

Reply via email to