Flex AutoComplete: Version 1.2

I’m just wrapping up a Flex project which used the component extensively. Along the way I noticed a number of reasonably serious bugs which this update fixes.

Latest version

  • When using the component as an item renderer the sizing is sometimes messed up
  • Prevented a toolTip from appearing when selecting an item
  • Resolved tab focus issue when using the component in a Flex 4 project

One other change in this release is that all private methods and properties have been changed to protected. Minor changes should no longer require using the sourecode.


35 responses to “Flex AutoComplete: Version 1.2”

  1. PB says :

    Awesome! Great timing for an update, and thanks again for such a wonderful contribution to the Flex community. I use it a lot!

  2. gowdhamanZee says :

    I love it and enjoy it to use. Is sources are in amy online repository?

  3. Ruben says :

    I can’t find the source code to download, can you help me?

  4. Ruben says :


  5. rohit says :

    Where to download 1.2 version.

  6. Skyzo says :

    I’ve make some modifications to get what I will:
    I wanted a combo without multiple selection and without selected item skin in prompt (I don’t know why to set the selectedItemStyleName property to “none” don’t work for me) .
    So I have put the property “_showSelectedItems” public to make it true. Then I changed the method “handleSelectedItemsChange ()” and commented out the line “searchtext = null;”
    I think this component can be easily modified to accommodate this simple use case.

  7. jimmy says :

    First, thanks for the excellent component.
    I use it with states and sometimes when it is in a hidden state, something is trying to get it to focus (not sure what). When this happens, it fails in FlowBox.mxml line 63 because “focusPane” is null. My fix is to add…
    if (focusPain != null) drawFocus(true);

    Just wanted to see if I could get that added to the trunk.

  8. John says :

    Great stuff! I have a comparative method, but it uses the local database and SQL statements to perform the search + auto complete. But I must say, your method is more elegant!!

    Can I ask, is it possible to do a search on multiple array fields? For example, to search ‘B5B35C’ for both labelField=”name” and labelField=”hex” and the result will show Olive Green.

  9. Jeff says :


    I’m seeing some html showing up in the labels for individual items that are not selected. Like A, etc. This disappears when the item is selected. Any advice? I’m using the Flex 4 version with the swc.


    • Hillel says :

      It’s hard to say, I haven’t seen that myself. If you could put together a sample application which demonstrates the issue I’d be happy to help debug it.

  10. Jeff says :


    I’ve sent you a screen grab of what I’m seeing. I’ve dug into the code and it appears to be an issue with the mx:Label that’s being used for the drop down item renderer. Basically it’s not interpreting the html tags – just sending it back as a string.

    I briefly looked into the Spark label and I see that it would have to rely on the Text framework as provided by Spark.


    • Hillel says :

      If you’re not already doing so you may want to set a custom item renderer. ColorItemRender.xml in the examples folder of the download is worth checking out.

  11. Gino says :

    I use the Flex 4 SWC but get the following error:

    warning: incompatible embedded font ‘ArialCFF’ specified for mx.core::UITextField (UITextField1486) . This component requires that the embedded font be declared with embedAsCFF=false.

    Are you sure you’re using flex 4 components in your SWC ?

    I cannot embed the font one more time just for this component, is there any workaround for this ?


    • Hillel says :

      The Flex 4 version is built with the MX component set (not spark), it’s just compiled against the 4.x SDK.

      Hope this helps…

      • Gino says :

        Thank you I figured that out later but still cannot make it work in my 4.5 application:
        If I use cff=true fonts, it complains, and if I use cff=false fonts, it also complains, so I’m pretty stuck🙂

        Maybe you are going to make a full flex 4 version someday ?

    • Marcelo Angel Marmol says :

      I am having the same issues here. I can make it work with Flex 4 using embedded fonts.
      Great component !

  12. Daniel says :

    I use the Flex 4.5 SWC.
    I have only one problem:
    AutoComplete.focusEnabled=true for the item focus with tabulator key didn’t work in mx:Form.

    It is an important functionality to work “mousless”.

  13. Davi Araya Bertolini (@oyedavi) says :

    Hi Hillel! once again, thanks for this amazing component! I’ve an issue and I would like a little help.

    I’m implementing a Virtual Keyboard that appears everytime a textfield is focused. Iv’e wrapped your AutoComplete class and given the “extra instruction” to dispatch the ShowVKeyBoard event.

    Now, for the keyboard to know where to type the characters, I’ve implemented a

    public static function getCurrentTextInputTarget(currentFocusedObject:IFocusManagerComponent):SkinnableTextBase{
    var txtTarget:SkinnableTextBase;

    }else if (objectClass == ShorterTextInput)
    txtTarget = currentFocusedObject as SkinnableTextBase;
    return txtTarget;

    then the keyboard uses the txtTarget.text property to write the keys.

    But as you can see, currentFocusedObject as SkinnableTextBase returns NULL cause your text area does not extends SkinnableTextBase.


    1): is ShorterTextInput the “skin part” that I want to write down the characters from my keyboard (i.e. programmatically?)

    2) if it is, does it extends from flash.text.TextField?

    3) if non of the above, any hint?

    THANKS and especially: Merry Christmas!

  14. sk says :

    Hi, I m using this component in Flex 4.1, I figure out sometime List shows blank rows. Same thing happened when select one item and if I selecting another one first item’s font goes invisible/blank.


    • Hillel says :

      I’d check for a possible null error in your redering logic (Flex swallows nulls in binding and can cause blank rows). Otherwise, if you could create a sample application demonstrating the issue I’d be happy to help debug it.

  15. Priya says :

    Hi Hillel,

    Thanks for educating us with your blogs and programs.. I am just a beginner in flex. Sorry for my silly doubt. I would like to use your component for my text box. I downloaded the source code and added it to my build path by choosing add swc folder. And also in my main.mxml file i added this line xmlns:components=”com.hillelcoren.components.*”> but I am getting an error

    The prefix “hc” for element “hc:Chooser” is not bound.

    Could you please guide me, on how should i debug it?

    Thanks in advance

    • Hillel says :

      Try adding this to the top of the page:


      Also, a simpler way to use the component is to put the swc file from the bin folder of the download in the lib directory of your flex project.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: