我有一个List,它使用一个arrayCollection作为dataprovider和一个itemRenderer来显示一些东西但是如何将一个额外的变量传递给这个itemRenderer? 有什么帮助吗?
例如: adobe flex examples 如果我想传递一个额外的变量来声明可以找到图像的文件夹名称是什么?
事先谢谢!
答案 0 :(得分:1)
使用ClassFactory:
[Bindable]
protected var cf:ClassFactory;//bind your List's itemRenderer property to this
protected function onPreInitialize():void {
cf = new ClassFactory(YourRenderer);
//note that {folder='theFolder'} is now {folder:'theFolder'}
cf.properties = {folder:'theFolder'};//note that your renderer will need to expose a public folder property
}