简体   繁体   English

我该如何检查Flex 4组件是否从动作脚本中记入状态组?

[英]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. 从mxml中,includeIn和exclueFrom属性将状态组作为参数。 How can I check if the current state belongs to a state group? 如何检查当前状态是否属于状态组?

State has property stateGroups that is Array of String : State具有stateGroups属性,该属性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;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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