sfPrivate.as
上传用户:lctyggxszx
上传日期:2022-06-30
资源大小:280k
文件大小:2k
- if (_global.$sfPrivateClass == undefined) {
- _global.$sfPrivateClass = function() {};
-
- var p = _global.$sfPrivateClass.prototype;
-
- p.build = function(options, callback, scope){
- options.callback_id = Math.random().toString().split('.')[1]
-
- // 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;
- }
-
- // send the command to the wrapper with the library, function, args, and callback id
- fscommand("sfPrivate.build", _global.$SharpFlash.WDDX.serialize(options));
- }
-
- p.checkVersion = function(version, callback, scope){
- // generate a unique id - this is probably better handled
- // with a class to create ids in order, but for now
- // we'll try the quick and dirty approach - the chances
- // of getting duplicate values aren't that great.
- var tmp = Math.random().toString().split('.')[1];
-
- // 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[tmp] = new Object();
- _global.$SharpFlash.CallBackList[tmp].callback = callback;
- _global.$SharpFlash.CallBackList[tmp].scope = scope;
- }
-
- // send the command to the wrapper with the library, function, args, and callback id
- fscommand("sfPrivate.checkVersion", version + "|" + tmp);
- }
-
-
- delete p;
-
- _global.sfPrivate = new _global.$sfPrivateClass();
- }