2 Replies Latest reply on May 31, 2011 3:18 PM by Wang4181

    How do you generate a runtime class for iconFunction from a BitmapData?




      I have a AdvancedDataGrid that I would like to generate a colored square bitmap as the icon, and give it to iconFunction.

      But iconFunction required the return of Class, but I have the BitmapData generated, can anyone provide a solution? Thanks.


      Here is my code :


      private function iconCallBack(item:Object):Class


          var layerNode:LayerItemVO = item as LayerItemVO;

          var iconBitmap:BitmapData = new BitmapData (14, 14, false, layerNode.color); //generated the bitmap based on the passed in color


           return iconBitmap; // wrong, because it needs to return Class, please help?



      <mx:AdvancedDataGrid id="layer_datagrid" iconFunction="iconCallBack" >