3 Replies Latest reply on Dec 16, 2008 2:26 PM by DrKippy

    Event when list item loses focus?

    DrKippy
      I'm trying to do something rather simple actually, but having a bit of difficulty with it.
      I'm working on something that will display a list of custom components (currently based on a canvas).
      When the item is selected I will be changing the state/appearance of the item, and triggering an event (no biggie there so far).

      What I'm trying to do, and having difficulty with, is triggering an event on the item when I select a new item.
      ie: if I choose box 3, then click on box 4, I'd like to do some work on box 3 (change its display for instance).

      I was trying to use itemFocusOut on the list, but that didn't seem to do anything.

      I don't think this should be too difficult, but I haven't found anything thus far. I can provide code examples and further information if it would be helpful.

      Thank you very much.
        • 1. Re: Event when list item loses focus?
          -Hob Level 1
          Try making your class implement IFocusManagerComponent. If your class is an actionscript class, you can just add, "implements IFocusManagerComponent" to your class statement. If its an MXML component, you'll need to add the following attribute to your canvas:

          implements="mx.managers.IFocusManagerComponent"

          You won't have to add any methods to complete the implementation. UIComponent implements them all for you, but without declaring that your class implements that interface, FocusManager won't take control of your component and dispatch the correct events.

          Hope that helps.
          • 2. Re: Event when list item loses focus?
            DrKippy Level 1
            That sounds like (without having tried it out yet) exactly what I need.

            Thanks a lot!

            I also found this to be useful. Not exactly what I was looking for, but it might be a more appropriate solution for this (or certainly other) problems.
            • 3. Re: Event when list item loses focus?
              DrKippy Level 1
              Hmm... Still no luck.

              I guess that was sort of what I was asking for, but I still can't get it to do what I'm trying to do.

              Essentially, I want to change some properties when the component (in the list) is selected, and when I select a new component (still in the list), I want to change those properties again (ie: reset them).

              I can't help but think I'm overlooking something simple here...