Create a star rating component in Flex

On http://cookbooks.adobe.com/post_Create_a_star_rating_component-561.html , you can see how to do a rating component with star, who is fashion now. The only problem is this componant is static, means,u can't rate yourself. So i did a little change to the component :

<?xml version="1.0" encoding="iso-8859-1"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
    horizontalScrollPolicy="off" verticalScrollPolicy="off">
   
    <mx:Script>
        <![CDATA[
            [Bindable]
            public var rating:Number = 0;
            public var i:int = 0;
            protected function starIcon_clickHandler(event:MouseEvent):void
            {
                rating=int(event.currentTarget.name);
            }
        ]]>
    </mx:Script>
   
    <mx:HBox horizontalGap="1" verticalCenter="0">
        <mx:Spacer width="4" />
        <mx:Repeater id="stars" dataProvider="{[1,2,3,4,5]}" count="5" >
            <mx:Image id="starIcon" name="{i++}" click="starIcon_clickHandler(event)" width="13" alpha="{(rating >= stars.currentIndex) ? 1 : .35}" source="@Embed('StarIcon.swf')" />
        </mx:Repeater>
        <mx:Spacer width="4" />
    </mx:HBox>
</mx:Canvas>
   
As u can see,i use a strange tips: i stock the value in the name! this look ugly but that's save my life many time yet ^^

(for StarIcon.swf or sample of use,it is exactly the same as Adobe website, so i don't copy it here).