Try setting focus before popping up the alert.
 
You can also set focus on close via callLater.
 
Both may show a flicker of the focus ring.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of candysmate
Sent: Sunday, September 02, 2007 7:54 AM
To: [email protected]
Subject: [flexcoders] Re: SetFocus() question



--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, Ben Marchbanks <[EMAIL PROTECTED]> wrote:
>
> Change the setFocus() call to be triggered by the alert "close"
event rather 
> than being called along with the Alert.show.
> 
> Ben Marchbanks
> 

Thanks Ben. I tried this without success:

private function accountCheck():void
{
if(goodsInGrowerAccount.text == "")
{

Alert.show("Please enter an account number\nbefore
entering an advice note number",'Caution:', 1, this, changeFocus,
stopIcon);

} 
}

private function changeFocus(event:CloseEvent):void
{
if(event.detail == Alert.OK)
{
goodsInGrowerAccount.setFocus();
}
}

What am I doing wrong please?



 

Reply via email to