Solution for 1067: Implicit coercion of a value of type String to an unrelated type mx.core:IFactory
Got this error in Flex?
1067: Implicit coercion of a value of type String to an unrelated type mx.core:IFactory.
You tried the following type of thing in your MXML and it worked:
But now you set it in actionscript and you get this error.
item.itemRenderer = "new ClassFactory(MyItemRenderer);"
Header Renderer Example
In my case I had the following in my Flex 4.6 project and it was working fine:
<s:GridColumn dataField="banana" headerRenderer="com.example.ui.RotateGridHeaderRenderer" />
Then I changed the code and wanted to create the columns dynamically in actionscript, but the following options gave me the above error:
column.headerRenderer = RotateGridHeaderRenderer
column.headerRenderer = "com.example.ui.RotateGridHeaderRenderer"
the solution was as above,
column.headerRenderer = new ClassFactory(RotateGridHeaderRenderer);