0 Replies Latest reply on Mar 2, 2008 1:50 AM by Neat Gadget

    AS2 IconCellRenderer multiple icons

    Neat Gadget
      I have been looking at an example from http://philflash.inway.fr/dgrenderer/dgiconrd.html

      It appears to be a very well known example. I am trying to emulate this in my own piece however the icons are not showing. If I pop one of the icons in the iconCellRenderer movie in the Library, then that one shows up.

      In the library I have an iconCellRenderer movie icon that has the appropriate linkage set as per the example. I have two other movie icons setup which are of images I imported into the library and converted to Symbol. Instead of reading from an XML I read from a mysql database. This is reading correctly and the appropriate values set for the column.

      I've spent the last week researching around and trying everything I can to get it to work.

      Any suggestions would be greatly appreciated.

      The IconCellRenderer.as file is exactly the same as the example above, just sitting in the same folder as the fla I am using.

      Below is the code I have in the fla

      import mx.controls.gridclasses.DataGridColumn;
      import mx.controls.DataGrid;
      import mx.controls.Button;


      var column = new DataGridColumn("MatterTypes");
      column.headerText = "MatterTypes";
      column.width = 50;
      column.cellRenderer = "IconCellRenderer";
      dg_event_listing.addColumn(column);


      dg_event_listing.setStyle("alternatingRowColors", [0xE6F1F3, 0xffffff]);
      dg_event_listing.rowCount = int((dg_event_listing.height - dg_event_listing.headerHeight)/dg_event_listing.rowHeight);

      var querySuccess:Boolean = mdm.Database.MySQL.runQuery("SELECT matter_type FROM matters");
      var eventDataSet = mdm.Database.MySQL.getData();
      var eventCount:Number = mdm.Database.MySQL.getRecordCount();

      var rows=0;
      var event_listing_array:Array = new Array();
      for (rows=0;rows<eventCount;rows++)
      {
      dg_event_listing.addItem();
      if (eventDataSet[rows][1]==1) {
      matter_type = "vendor"
      } else {
      matter_type = "purchaser"
      }
      event_listing_array.push({MatterTypes: matter_type});
      }


      dg_event_listing.dataProvider = event_listing_array;
      dg_event_listing.editable = false;

      dg_event_listing.selectedIndex=-1;

      stop();