actionscript-3 - 为每个循环留一个

标签 actionscript-3 apache-flex actionscript

一旦 bool 值设置为 true,我想离开 for each 循环。

for each (xmlEvent in arEvents)
{
    var xmlEvent:XMLList = XMLList(event);
    if(xmlEvent.id == artistEvent.id)
    {
        boolExists = true;
    }
}

我试过 break 之类的,但这一切都行不通。

最佳答案

使用break运算符(operator)

for each (xmlEvent in arEvents)
{
    var xmlEvent:XMLList = XMLList(event);
    if(xmlEvent.id == artistEvent.id)
    {
        boolExists = true;
        break;
    }
}

关于actionscript-3 - 为每个循环留一个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8419281/

相关文章:

apache-flex - AS3 : Detect Read-Only Properties

flash - 尝试从 JS 调用 ActionScript 函数时出现安全错误

flash - 滚动条问题

apache-flex - 在 flex builder 中制作一个标签作为 url 链接

actionscript - Flash流播放器(教程?)

php - 将 AS3 与 PHP 通信。发送变量到php页面,但$_POST为空

actionscript-3 - AS3 : Is it possible to capture stage elements or bitmap data into a netstream?

actionscript-3 - 如何在 flex 3 中将日期转换为字符串

javascript - 从 flash 调用 jQuery 函数

actionscript-3 - 减小 SWF 文件大小