sfSystemMessageBox.as
上传用户:lctyggxszx
上传日期:2022-06-30
资源大小:280k
文件大小:2k
- if (_global.$sfSystemMessageBoxClass == undefined) {
- _global.$sfSystemMessageBoxClass = function() {};
-
- var p = _global.$sfSystemMessageBoxClass.prototype;
-
- // define the constants used to configure the messagebox -
- // make sure these values correspond with whats inside
- // the sfSystemMessageBox.dll
- _global.MBB_AbortRetryIgnore = 1;
- _global.MBB_OK = 2;
- _global.MBB_OKCancel = 3;
- _global.MBB_RetryCancel = 4;
- _global.MBB_YesNo = 5;
- _global.MBB_YesNoCancel = 6;
-
- _global.MBI_Asterisk = 1;
- _global.MBI_Error = 2;
- _global.MBI_Exclamation = 3;
- _global.MBI_Hand = 4;
- _global.MBI_Information = 5;
- _global.MBI_None = 6;
- _global.MBI_Question = 7;
- _global.MBI_Stop = 8;
- _global.MBI_Warning = 9;
-
- _global.MBD_Button1 = 1;
- _global.MBD_Button2 = 2;
- _global.MBD_Button3 = 3;
-
- p.messageBox = function(text, caption, buttons, icon, defaultButton, options, callback, scope){
- var settings = new Object();
- settings.text = text;
- settings.caption = caption;
- settings.buttons = buttons;
- settings.icon = icon;
- settings.defaultButton = defaultButton;
- settings.options = options;
-
- settings.callback_id = Math.random().toString().split(".")[1];
-
- fscommand("sfSystem.MessageBox.messageBox", _global.$SharpFlash.WDDX.serialize(settings));
-
- // save a reference to the callback function at a location that
- // the wrapper program "knows" about
- if (callback != undefined) {
- if (scope == undefined) {
- scope = this;
- }
- _global.$SharpFlash.CallBackList[settings.callback_id] = new Object();
- _global.$SharpFlash.CallBackList[settings.callback_id].callback = callback;
- _global.$SharpFlash.CallBackList[settings.callback_id].scope = scope;
- }
- }
-
- delete p;
-
- _global.sfSystem.MessageBox = new _global.$sfSystemMessageBoxClass();
- }