简体   繁体   中英

How can I check if a Flex 4 component belogs to a stategroup from actionscript?

I have a component with various states. From mxml, the includeIn and exclueFrom properties takes state groups as an argument. How can I check if the current state belongs to a state group?

State has property stateGroups that is Array of String :

var n:int = states.length;
for (var i:int = 0; i < n; i++)
{
    var state:State = states[i];
    if (state.name == currentState)
    {
        trace("Current state (" + currentState + ") state groups: " + state.stateGroups);
        break;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM