我有一个 flex 脚本,它基本上在执行时会向用户提示一条警报消息。说我的结果是这样的:
1) 巴贾杰, 2) 卡塔利娜 3) 安德森 4) 迈克尔
然后,警报提示会自动对它们进行排序并显示如下结果:
“你这样做是为了 1. Anderson,2. Bajaj 3. Catalina 4. Michael”
本质上,触发事件的顺序已由 Flex 出于礼貌进行排序,我不希望这种排序发生。
这里有一些代码可以细细琢磨:
<mx:Button label="Save" id="save" width="60" enabled="{showSaveBtn}"
click="saveConfig();" right="0" bottom="0"/>
function saveConfig()
{
// internally calls the function where the alert is supposed to be displayed:
// doThis
}
private function doThis(event:ResultEvent):void
{
selectConfigDG.selectedItem = defaultSelectedConFig;
this.changeConfig = false;
this.savedMessage.visible = true;
this.savedMessage.includeInLayout = true;
this.savedMessage.htmlText = "Configuration " + "<b> \" " + defaultSelectedConFig.description +
" \" </b>" + " has been changed." + " <b> ";
var resultString = event.result as String;
if(resultString != null && (StringUtil.trim(resultString)).length != 0)
{
var htmlBody:String = resultString;
var alert:Alert = Alert.show(htmlBody,'',Alert.OK);
use namespace mx.core.mx_internal;
IUITextField(alert.alertForm.textField).htmlText = htmlBody;
}
this.savedMessage.validateProperties();
}
在上面的代码中,有趣的是 event.result 作为 String 片段。基本上,解决了这个问题。我希望它保持秩序。我如何让 Flex 做到这一点?