Flash Form Theme Color Gotcha

Posted By : todd sharp Posted At : September 28, 2006 2:40 PM Posted In: Flash Forms, ColdFusion

1

Scott Stroz posted a few days ago about a cool way to customize the 'skin' color of a flash form. I mentioned in the comments that I had experienced some weirdness with datagrids not obeying the themeColor. Scott mentioned that his datagrids did obey the new themeColor, so I did a quick experiment. I found out that by setting the themeColor as an inline style using Scott's method will properly style the grid, but using formatting the way that I was using setStyle in Actionscript is what caused the grid weirdness.

Scott's Method (The Good Way)

<cfform format="flash" style="themeColor:##FF6666;">
    <cfinput type="text" name="foo" label="foo">
    
    <cfgrid name="fooGrid">
        <cfgridcolumn name="fooCol"/>
        <cfgridrow data="fooData"/>
    </cfgrid>
</cfform>

My Method (The Bad Way)

<cfform format="flash" onload="a();">
    <cfformitem type="script">
    function a(){
    _global.styles.Form.setStyle("themeColor", 0xFF6666);
    }
    </cfformitem>
    <cfinput type="text" name="foo" label="foo">
    
    <cfgrid name="fooGrid">
        <cfgridcolumn name="fooCol"/>
        <cfgridrow data="fooData"/>
    </cfgrid>
</cfform>

Comments (1)

roger's Gravatar Is there any way you can, bind a return variable to the "style" attribute of the cfform tag? Just a thought...