Take the 2-minute tour ×

I am trying to create a spark datagrid item renderer. This item renderer extends a checkbox, and implements IGridItemRenderer

public class CellCheckBoxItemRenderer extends CheckBox implements IGridItemRenderer

When I implement IGridItemRenderer, I need to implement the interface methods, I am having a problem with the following methods:

public function get hovered():Boolean

public function set hovered(value:Boolean):void

since the methods are inherited as well from the checkbox

EDIT The signatures of the functions

//spark checkbox signature
protected function get hovered():Boolean
protected function set hovered(value:Boolean):void

and the signature above belongs to the interface IGridItemRenderer

share|improve this question
does methods in class and interface have the same signature? –  Eugeny89 Dec 31 '11 at 7:48
@Eugeny89 no, they dont –  Mansuro Dec 31 '11 at 10:15
can you list here signatures of functions? Maybe me or someone else advise some workaround –  Eugeny89 Dec 31 '11 at 12:15
@Eugeny89 I've edited the question –  Mansuro Dec 31 '11 at 13:29
add comment

2 Answers

up vote 1 down vote accepted

I guess the implementation of IGridItemRenderer is the more important part, so you can use it in a datagrid. The CheckBox provides just the functionality, you don't have to extend it if there are conflicts in my opinion.

public class CellCheckBoxItemRenderer implements IGridItemRenderer {

    private var checkBox:CheckBox;

    public function getCheckBox {
        return checkBox;


If CheckBox would implement any useful interfaces, you could also implement them in your renderer and delegate the methods to the checkbox, which may let you encapsulate the whole checkbox. That's not the case here though.

share|improve this answer
add comment

The problem is that interfaces, by design, only specify the signature for public functions, whereas the function in Checkbox is set as protected.

The only solutions:

  • remove the interface/Checkbox class from CellCheckBoxItemRenderer
  • remove the declaration from the interface
  • change Checkbox so hovered is a public property
  • it might be possible to change the accessor dynamically using the as3 commons bytecode project (http://www.as3commons.org/as3-commons-bytecode/emit.html), but I'm not 100% sure.
share|improve this answer
add comment

Your Answer


