Pages

February 09, 2011

Spark ItemRenderer States Bug

Hi guys,
Here is something I found myself struggling with for an hour, and I thought I might spare you the time. In spark, when you wish to create a Spark Item Renderer, you typically create a new class that extends, obviously enough, the ItemRenderer class.
This is what I did, but I wanted more functionality to it, and implemented some states to that renderer. Which is trivial enough, some might say...
What happened is, that when hovering over the Item Renderer I've just created, the states started acting weird. Mainly changing to the initial state for no real reason.
This seemed to be a nice voodoo in the making, but after diving in a bit , I found out that what causing the trouble is the Super ItemRenderer Class itself.

Why?
It has many features, some are related to states (normal, hovered - rings a bell?). This states handling goes crashing into the state behavior I wanted so… now I have the cause.

Solution
The way to go in my situation is using the DataRenderer which is a simple Group based Class that only implements the IDataRenderer. That is exactly what I need, and thank you for sparing me all the extra Bytes for functionality I don't need, Adobe. next time, try and direct me into using it in the first place...

That's all, people.
Take care.

2 comments:

Unknown said...

תגיד, זה אתה?
אם כן איפה אתה?!?!?!
רק בגלל שאני לא בטוח אני לא קורא לך בשמות.....

Flashmattic said...

בנאדם,
יש כתובת בשביל דברים שכאלה:
זה השם של הבלוג בג'ימייל - נסה אותי שם.
:)