【发布时间】:2016-01-21 12:25:58
【问题描述】:
I have a list of check boxes that when selected the getEventName method should reurn the key that matches the label.例如,如果标签是“NEW”,则应该在 map[key] = “new” 时返回键。这些已在下面的 LABEL_EVENTTYPE 函数中定义。它总是返回一个空字符串,似乎无法弄清楚为什么。
public static const LABEL_EVENTTYPE_MAP:Object = {
"CANCEL":["cancelled","expired", "doneForDay"],
"NEW":["new"],
"TRADE":["trade"],
"AMEND":["replaced"],
}
private function getEventName(label:String):String{
var map:Object = ReplayConstants.LABEL_EVENTTYPE_MAP;
for each(var key:String in map){
if (map[key] == label){
return key;
}
}
return "";
}
【问题讨论】:
标签: actionscript-3 apache-flex actionscript mapping flash-builder