开发者

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

开发者 https://www.devze.com 2023-01-10 18:40 出处:网络
I have a component开发者_C百科 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?

I have a component开发者_C百科 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;
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消