4 Replies Latest reply on Aug 3, 2007 6:34 AM by

    Identifying an HBox within a Repeater

      I am trying to change the background color on an HBox that is within a Repeater when a LinkButton is clicked. In the function below, I am hardcoding the index of the HBox just to try to get a result, but nothing is happening.

      Any help is appreciated. (And I MAY be doing this the completely wrong way, so feel free to tell me I'm wrong.) Thanks!


      <mx:Repeater id="videoRepeater" dataProvider="{videoAlbums.albums}" width="100%">
      <mx:HBox id="hbox1" width="100%" backgroundColor="#FFFFFF">
      <mx:LinkButton label="{videoRepeater.currentItem.title}" click="handleClick(event);" />
      </mx:HBox>
      </mx:Repeater>


      public function handleClick (event:MouseEvent) : void
      {
      hbox1[0].backgroundColor = "#FF0000";
      loadAlbum(event.currentTarget.getRepeaterItem());
      }