我有一个模拟枚举如下:
public class Sport {
public static const BASEBALL:Sport = new MyEnum("Baseball", "Baseball ...");
public static const FOOTBALL:Sport = new MyEnum("Football", "Football ...");
public var label:String;
public var description:String;
public function Sport(label:String, description:String):void {
this.label = label;
this.description = description;
}
}
绑定到这些枚举的按钮如下:
<mx:Button label="{Sport.BASEBALL.label}" toolTip="{Sport.BASEBALL.description}"/>
我现在需要本地化这个枚举,但是当我更新语言环境时,我没有太多运气让绑定与其他所有内容一起更新:
resourceManager.localeChain = [ localeComboBox.selectedItem ];
我尝试将 getter 绑定到据称由 ResourceManager 抛出的“更改”事件,但这似乎不起作用。有任何想法吗?