Skip to main content
Participant
Jun 11, 2011 2:27 AM UTC
Question

ItemRender view states

Hello, I think I found an issue.
Have any of you heard of a problem with ItemRender's view states.
Primarily a itemrender custom view state.

If you set the current state to a custom state, then
move the mouse over the IR, the hover property sets, and then
the state shifts to the first defined view state(assuming that
the state you set is different)

I have an example project that illustrates.

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

JDurham25Author
Participant
Jun 11, 2011 10:17 PM UTC

Wait a moment.

This was a problem in the SDK version 4.1 and earlier.

I installed 4.5 and found this in the IR source:

protected function getCurrentRendererState():String
    {
        // this code is pretty confusing without multi-dimensional states, but it's
        // defined in order of precedence.
       
        if (dragging && hasState("dragging"))


  ...... Omited Code ......


        if (hasState("normal"))   
            return "normal";
       
        // If none of the above states are defined in the item renderer,
        // we return currentState, so we don't change the state just
        // in case the developer put the item renderer into its
        // own custom state.
        return currentState;
    }

This is very different from the original which returned null.

Translate
Inspiring
Jun 11, 2011 3:28 AM UTC

If you add custom states, you have to override logic that sets the states.

In 4.5, we added a getCurrentSkinState() method

Translate
JDurham25Author
Participant
Jun 11, 2011 9:42 PM UTC

Do you mean getCurrentRendererState() function?

There is no getCurrentSkinState() on an ItemRender.

This function does the same basic thing, though, right?

Translate