0
votes

I have a class (1) extended from ListBase which, for it's itemRenderer, uses another class (2) extended from ItemRenderer

There is a button in (2) that when clicked, sets it's itemRenderer instance to selected. This work as expected (the state changes).

The problem I have is that if then I click the button on another itemRenderer instance, I want the first itemRenderer instance to be not selected. So there is only ever 1 or 0 itemRenderers selected at one time. This is not happening and I can't work out how to do it.

I am using Spark components.

Any ideas?

1

1 Answers

0
votes

this is a common actionscript problem whereby you are re-casting the object which therefore wipes out the property-values of them. (usually in the reference call where you are taking the button-click and turning it into a reference of the object).

best method is to , when instantiating the itemRenderer objects, push them into an array that you can reference into later.