Datagrid rowHeight question

Hi,

I am very new to flash and am just winging it here to update parts of our existing html site to flash (using CS3, AS3).

We have an html timeline that lists our projects, etc, and when clicked on goes to several pages of pictures:

http://www.mikesmithstudio.com/projects/0.htm

I have already created a flash ‘timeline’ by customizing the datagrid component in AS3 and linking it to an xml file:

(rough draft version, lots of clean up needed and buttons to be finished)

http://www.mikesmithstudio.com/testing%20flash/indexprojectsflash.htm

I’m surprised I’ve even made it this far on my own, and I feel I can sort out most of the rest, but I’m stuck on one particular thing which is setting the row height so that if the words are wrapping, the row height changes dynamically.

All the research I’ve done so far comes up with the AS3 component NOT allowing variable rowHeight, but I feel like there must be some workaround

i.e. somehow cracking/over-riding the default rowHeight settings by replacing it with some kind of function that counts the characters in certain columns, and if the characters are over a certain number, then the rowHeight is set to ‘X’, else the rowHeight is ‘Y’ (only 2 different rowHeights are needed).

PPPPPLLLLLEEEEEAAAASSSEEEE help if you can

main code used thus far:

import fl.controls.DataGrid; 
import fl.controls.dataGridClasses.DataGridColumn; 
import fl.data.DataProvider; 
import flash.events.MouseEvent; 
import fl.controls.List; 

//The datagrid, images, and project descriptions all loading into 'holderClip' 
addChild(holderClip) 

////LOAD AND FORMAT DATAGRID 
    ///FORMAT TEXT: 

var colorTextFormat:TextFormat = new TextFormat(); 
colorTextFormat.size = 11; 
colorTextFormat.color = 0xFFFFFF; 
colorTextFormat.font = "Verdana"; 

    ////HEADER TITLES: 
//var dp:DataProvider; 

var c1:DataGridColumn = new DataGridColumn("PROJECT"); 
c1.width = 190; 
var c2:DataGridColumn = new DataGridColumn("ARTIST"); 
c2.width = 110; 
var c3:DataGridColumn = new DataGridColumn("INTERACTION"); 
c3.width = 130; 
var c4:DataGridColumn = new DataGridColumn("YEAR"); 
c4.width = 42; 
//var c5:DataGridColumn = new DataGridColumn("record_no") 
//c5.width = 0; 



var projects_dg:DataGrid = new DataGrid(); 

projects_dg.setStyle("headerTextFormat", colorTextFormat); 
projects_dg.setRendererStyle("textFormat", colorTextFormat); 
projects_dg.addColumn(c1); 
projects_dg.addColumn(c2); 
projects_dg.addColumn(c3); 
projects_dg.addColumn(c4); 
//projects_dg.addColumn(c5); 
projects_dg.resizableColumns = false; 
projects_dg.sortableColumns = false; 
projects_dg.setSize(500, 540); 
//projects_dg.y = (24); 
projects_dg.rowCount = (25) 
projects_dg.rowHeight = (29) //SET UP A "CASE" OF ROW HEIGHT? I.E. IF CHARACTERS GREATER THAN X, OR IF LINES > 1, THEN ROWHEIGHT = Y? 
projects_dg.setStyle("cellRenderer", CustomRowColors); 
holderClip.addChild(projects_dg); 


/////LOAD XML INTO DATAGRID 
var url:String = "MSS.xml"; 
var DGrequest:URLRequest = new URLRequest(url); 
var DGuLdr:URLLoader = new URLLoader(); 
DGuLdr.addEventListener(Event.COMPLETE, completeHandlerDG); 
DGuLdr.load(DGrequest); 

function completeHandlerDG(event:Event):void { 
    var ldr:URLLoader = event.currentTarget as URLLoader; 
    var xmlDP:XML = new XML(ldr.data); 
        //xmlDP.ignoreWhitespace = true; 
    var dp = new DataProvider(xmlDP); 


    projects_dg.dataProvider = dp; 
    // trace(xmlDP);  
      
} 


////////// LINK TO SELECTED PROJECT ON CLICK 

var pdtext:TextField = new TextField(); 

//var imageLD:Loader = new Loader() 

function linktoProject(event:MouseEvent):void 
{ 
    var selectedproj = (projects_dg.selectedItem.record_no); 
    var selectedpd = (projects_dg.selectedItem.PROJDESC); 
        trace(selectedproj); 
        //trace(selectedpd); 
         
        //SET HEADER TEXT: 
        textFieldA.text = ("/ " + projects_dg.selectedItem.INTERACTION + " / " + projects_dg.selectedItem.YEAR + " / " + projects_dg.selectedItem.ARTIST + " / " + projects_dg.selectedItem.PROJECT); 
        imageNUMB.text = (projects_dg.selectedItem.record_no); 

     
        //SEARCH FOR PROJECT DESCRIPTION, LOAD TEXT AND FORMAT BACKGROUND 
     
         

        ////IF PROJECT DESCRIPTION EXISTS>>CREATE/FORMAT TEXTFIELD: 
        if (selectedpd != undefined) { 

                  //var pdtext:TextField = new TextField(); 

                    holderClip.addChild(pdtext); 
         
                    pdtext.text = selectedpd; 
                    pdtext.x = 0; 
                    //pdtext.y = 24; 
                    pdtext.width = 500; 
                    pdtext.height = 540; 
                    pdtext.background = true; 
                    pdtext.wordWrap = true; 
                    pdtext.backgroundColor = 0x00000;  
//                    pdtext.backgroundColor = (textField, pdCustumBkgColors); 
                //FORMAT: 
                    var pdformat:TextFormat = new TextFormat(); 
                    pdformat.font = "Verdana"; 
                    pdformat.color = 0xFFFFFF;  
                    pdformat.size = 11; 
                    pdformat.leftMargin = 6; 
                    pdformat.rightMargin = 6; 
            //        pdtext.embedFonts = true;  

                    //pdtext = new TextField(); 
                    pdtext.setTextFormat(pdformat); 
                     
                    /////NEED TO ADD A TRANSITION 
                 
        }else { 
                ////REMOVE PROJ DESC TEXTFIELD: ...??? COULD BE ADDED TO PROJECTS HEADER BUTTON INSTEAD? 
                if( this.contains( pdtext ) ){   this.removeChild( pdtext ) ;} 
                 
                ////LOAD IMAGES FROM CORRECT FOLDER> SEE "IMG LOADER" LAYER FOR SCRIPT 
                ImageLoad("images/" + selectedproj + "/" + "1" + ".jpg",holderClip,0,0); 
   
                   
} 
     
        ////////REMOVE DG 

    removeEventListener(Event.COMPLETE, completeHandlerDG); 
    holderClip.removeChild(projects_dg); 
     
     
    } 

projects_dg.addEventListener(MouseEvent.CLICK, linktoProject);  

*k