cant you just use this.currentState
For a List that is using virtual layout (cause I have Lots of items), using this.currentState is bad for ItemRenderers, cause in most cases the Flash Builder will loose reference to a specific item that's item has been changed, especially if that item goes off screen.
1 person found this helpful
Short answer: You'll have to reimplement your itemRenderer. It is unclear from your code snippet how you have implemented states.
The IconItemRenderer extends LabelItemRenderer which extends UIComponent.
Mobile ItemRenderers are implemented differently than MXML ItemRenderers. They are more like Mobile Skins than Spark components, or Spark ItemRenderers. States are really just a fantasy; and you implement states by making changes to children, colors, or other visual elements manually in updateDisplayList(); or if you follow the MobileSkin conventions, in layoutContents() and drawBackground().
The method you're looking for is implemented in the itemRenderer class, which Mobile ItemRenderers do not implement. These are some blog posts I wrote on building Mobile itemRenderers:
I have one coming soon on implementing states in Mobile Skins; which will apply equally to itemRenderers. I'll go over most of the content in tomorrow's Flextras Friday Lunch episode
Jeffrey!! Thanks a lot for the info :) I'll go over it. You won't remember me, we met in Flex 360 Atlanta a few years back :p
I'll tell you what I tell a lot of people I meet at conferences:
"I'm sorry I don't remember you, I'm horrible w/ names and faces."
But, be sure to get at the next 360 and say Hi.