sfSystemDialogs.as
上传用户:lctyggxszx
上传日期:2022-06-30
资源大小:280k
文件大小:1k
- if (_global.$sfSystemDialogsClass == undefined) {
- _global.$sfSystemDialogsClass = function() {};
-
- var p = _global.$sfSystemDialogsClass.prototype;
-
- p.BrowseForFile_Open = function(fileName, typeFilter, intialPath, caption, callback, scope){
- var options = new Object();
- options.fileName = fileName;
- options.typeFiler = "";
- for (var i = 0; i < typeFilter.length; i++) {
- options.typeFilter += typeFilter[i] + "|";
- }
- // remove the trailing "|"
- options.typeFilter = options.typeFilter.substring(0, options.typeFilter.length-1);
- options.initialPath = intialPath;
- options.caption = caption;
- options.callback_id = Math.random().toString().split(".")[1];
-
- fscommand("sfSystem.Dialogs.BrowseForFile_Open", _global.$SharpFlash.WDDX.serialize(options));
-
- // 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[options.callback_id] = new Object();
- _global.$SharpFlash.CallBackList[options.callback_id].callback = callback;
- _global.$SharpFlash.CallBackList[options.callback_id].scope = scope;
- }
- }
-
- delete p;
-
- _global.sfSystem.Dialogs = new _global.$sfSystemDialogsClass();
- }