8 Replies Latest reply on Jul 14, 2009 11:49 AM by Jed Schneider

    assign itemRenderer property to ADG in actionscript - fails type coercion

    Jed Schneider

      I am getting a coercion error (1067):

      Implicit coercion of a value of type vgRenderer to an unrelated type mx.core:IFactory. 

       

      I am wondering what I am doing wrong... Thanks

       

      import vgRenderer;

      gridColumn:AdvancedDataGridColumn = new AdvancedDataGridColumn();

      gridColumn.itemRenderer = new vgRenderer();

       

       

      I also tried

      var vg:vgRenderer = new vgRenderer();

      gridColumn.itemRenderer = vg;

       

      vgRenderer code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox
          xmlns:mx="http://www.adobe.com/2006/mxml"
          width="160"
          height="120">
              <mx:Script>
              <![CDATA[
                  [Bindable]
                  private var imageSource:String;
                 
                  override public function set data(value:Object):void
                  {
                      var o:Object = value;
                      imageSource = o.representativeImage.toString() as String;
                  }
              ]]>
          </mx:Script>
          <mx:Image
          xmlns:mx="http://www.adobe.com/2006/mxml"
          width="160"
          height="120"
          source="{imageSource}"
          >
             
          </mx:Image>
      </mx:VBox>