【发布时间】:2010-12-02 04:16:21
【问题描述】:
我正在开发一个 AIR 应用程序,该应用程序需要一个仅在第一次运行时才显示的菜单。用户可以在其中选择运行应用所需的语言。
我显示这个菜单没有问题,但我需要它保持可见直到“选择语言”组合框被更改,然后返回所选选项的数据值。
我的问题是,只有在组合框更改后,我似乎无法弄清楚如何返回值。
function promptFRMenu():String{
FRMenu.enabled = FRMenu.visible = true; //when I detect the app is running for the
// first time, the dialog box is enabled
// and made visible
var peferedLng:String = new String;
FRMenu.language_CBox.addEventListener(Event.CHANGE, announceSelectedItem);
function announceSelectedItem(e:Event):void {
FRMenu.enabled = FRMenu.visible=false;
peferedLng = e.target.selectedItem.data;
-> return peferedLng;
//It is the 'parent' function that should return this value but
// only after it is selected
}
}
非常感谢任何帮助。 干杯!
【问题讨论】:
标签: flash actionscript-3 combobox event-handling return-value