On a recent project I was working on, another team required a ratings bar so I thought I put something together. It works very much like a Flex 4 List, but all item renderers at an index below the selectedIndex are selected. It also enables you to drag on the bar once you have click on it to change the rating given (mainly implemented for touch devices).

As with most (vote & vote please) spark components you can change the layout, renderer, skin etc.

For ease of use there is also a numRatings property that internally creates an ArrayList with the correct length to be used as a dataProvider for the component, although if required (i.e. you want custom labels etc to be shown) you can set you own dataProvider.

(right click for source).

The source can be downloaded only from our GitHub repository (only added to the Flex 4.5 lib at the moment). I’ll get it into the 4 lib and up on our Google Code repository soon.

  • ws.tink.spark.controls.RatingsBar (4.5)
  • ws.tink.spark.itemRenderers.RatingsBarItemRenderer (4.5)
  • ws.tink.spark.skins,controls.RatingsBarSkin (4.5)
  • 7 Responses to “RatingsBar”

    1. JabbyPanda says:

      Error #2032 on demo SWF load

    2. JabbyPanda says:

      From home, SWF file loads fine. Let’s call the case resolved.

    3. Jesus says:

      Greetings from Mexico!

      Nice demo! but I have a problem, I downloaded the source code and when I export the project into Flash Builder, there’s an error “unable to open ‘\flex4.5_spark\bin\flex4.5_spark.swc’”

      I tried to copy and paste the files of the links into the project but I have another error, there say that I need ws.tink.graphics.utils.StarUtil and I looked it into GitHub but I didn’t find it :(

      Can you help me please?

    4. Tyrone Neill says:

      That is a sexy rating bar big man! sure to use that thang!

    5. Alex says:

      Hi, the project is unavailable on the Git can you please provide another link ?

    Leave a Reply