Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 如何在flex中动态指定项目渲染?_Actionscript 3_Apache Flex_Flex4.5 - Fatal编程技术网

Actionscript 3 如何在flex中动态指定项目渲染?

Actionscript 3 如何在flex中动态指定项目渲染?,actionscript-3,apache-flex,flex4.5,Actionscript 3,Apache Flex,Flex4.5,我想用如下代码更改列表的项目渲染: booklist.itemRenderer = BookItemRender; BookItemRender是s:ItemRenderer的一个子类 It报告错误: 1067: Implicit coercion of a value of type Class to an unrelated type 如何在代码中正确指定itemRender?必须为此指定ClassFactory实例: booklist.itemRenderer = new Class

我想用如下代码更改列表的项目渲染:

booklist.itemRenderer = BookItemRender;
BookItemRender是s:ItemRenderer的一个子类

It报告错误:

1067: Implicit coercion of a value of type Class to an unrelated type 

如何在代码中正确指定itemRender?

必须为此指定ClassFactory实例:

booklist.itemRenderer = new ClassFactory(BookItemRender);
可能重复