1. You have to make sure the class you want actually got linked into the SWF. It may not be there unless explicitly declared in the SWF. Use -link-report to find out. 2. The function you want must also be in the SWF and defined on some object. If it is a static method, then getDefinition(MISFormatter) should give you the class and then classDefinition["formatGSCPercent"] should give you the function.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ilikeflex Sent: Monday, March 24, 2008 9:25 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] How to add labelfunction dynamically Hi I am reading the xml file and creating the columns. Everything is working fine except <bind id="6" order="3" textAlign="center" width="60" headerText="%" sortable="false" dataField="Current GSC" labelFunctionName="MISFormatter.formatGSCPercent" itemRendererName="com.ubs.flex.mis.panels.grids.GridLinkCell" /> 1.itemrenderer I am reading the name of itemrenderer from xml file then i am doing classDefinition = getDefinitionByName(itemRendererName) as Class; column.itemRenderer = new ClassFactory(itemRendererClass); It gives me error: No constructor error. How to solve this??? 2.labelfunction I am reading the name of itemrenderer from xml file then i am doing column.labelFunction = labelFunctionName; I know column.labelFunction takes function. But i do not know how to conver string which conatins the function name into function Object. Please help. Thanks ilikeflex