sstauross
sstauross

Reputation: 2680

pass extra variable in an itemRenderer

i have a List which uses a an arrayCollection as dataprovider and an itemRenderer to display some things but how can i pass an extra variable to this itemRenderer?? Any help?

for example here: adobe flex examples what if i want to pass an extra variable to declare what is the folder name where the image can be found?

Thanks beforehand!

Upvotes: 0

Views: 652

Answers (1)

Amy Blankenship
Amy Blankenship

Reputation: 6961

Use a 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
}

Upvotes: 1

Related Questions