I'm currently building a Flex 4.5 mobile project including several views and custom written MXML components that can be incorporated dynamically into those views. How do I determine which component currently has focus, namely has been activated by the user tapping on it? The background for this is a global search function in the main application. Depending on the results of this search, fields in the custom components are set. Given that I don't want all components in a view to listen to the outcome of that search function, I have to check which one is currently active. I'm trying to bind the selected object (the result from the search function) to the active component.
Any help would be much appreciated.
Cheers!
You can determine which component currently has focusing using the FocusManager.getFocus(). Conceptually something like this:
var ComponentWithFocus : IFocusManagerComponent= FocusManager.getFocus();