The List:

my_lb.addEventListener("keyDown", Delegate.create(this, onDeleteItem));

private function onDeleteVariable():Void
 {
  if(Key.getCode() == Key.DELETEKEY)
  {
   var index:Number = variables_lb.selectedIndex;
   if(index != null)
   {
    variables_array.removeItemAt(index);
   }
  }
 }

What I'm trying to achieve is when you select an item in the list, and hit 
the delete key, it deletes the item in the dataprovider.  I got it to work 
in preliminary tests, but I'm thinking as my UI got bigger someone started 
stealing the click.  Like, if you click the Up arrow key with the item 
selected, the radio buttons to the right, in another form, actually change 
selection... they don't even have focus...


----- Original Message ----- 
From: "Spike" <[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Friday, April 15, 2005 1:45 PM
Subject: Re: [flexcoders] keyDown & List



Is your keyDown event attached to the list or to each of the elements of
the list?

If it's attached to the list, I'd expect to see the behaviour you're
describing.

If it's attached to each of the elements of the list I'm not sure what's
going on.

Spike

JesterXL wrote:
> Ok, this is weird.  I'll probably track it down, but still waking up.
>
> If I click on a List, and hit a key, my keyDown event is fired.
>
> If I click on an item in the list, and hit a key, my keyDown event isn't
> fired.
>
> If I click on an item in the list, and click the list where an item is 
> not,
> and then hit a key, my keyDown event is fired.
>
> ...wtf?  Why does selecting an item in my list prevent this?  Key's like 
> "d"
> and stuff will automatically scroll (I'm guessing it's capturing the key 
> and
> trying to scroll to the first label that starts with the letter "d", like
> the ComboBox does).
>
> If it's any help, I have 2 lists in existence; since my TabNavigator has
> creationPolicy all... is maybe 1 intercepting it or something?  This is
> annoying...
>
> --JesterXL
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>

-- 

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org



Yahoo! Groups Links








 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to