home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Darbas / kidoz_v1.air / kidoz.swf / scripts / _com_flex_ErrorAlertWatcherSetupUtil.as < prev    next >
Encoding:
Text File  |  2009-05-06  |  2.0 KB  |  52 lines

  1. package
  2. {
  3.    import com.flex.ErrorAlert;
  4.    import flash.display.Sprite;
  5.    import mx.binding.FunctionReturnWatcher;
  6.    import mx.binding.IWatcherSetupUtil;
  7.    import mx.binding.PropertyWatcher;
  8.    import mx.binding.StaticPropertyWatcher;
  9.    import mx.core.Application;
  10.    import mx.core.IFlexModuleFactory;
  11.    
  12.    public class _com_flex_ErrorAlertWatcherSetupUtil extends Sprite implements IWatcherSetupUtil
  13.    {
  14.       public function _com_flex_ErrorAlertWatcherSetupUtil()
  15.       {
  16.          super();
  17.       }
  18.       
  19.       public static function init(param1:IFlexModuleFactory) : void
  20.       {
  21.          ErrorAlert.watcherSetupUtil = new _com_flex_ErrorAlertWatcherSetupUtil();
  22.       }
  23.       
  24.       public function setup(param1:Object, param2:Function, param3:Array, param4:Array) : void
  25.       {
  26.          var target:Object = param1;
  27.          var propertyGetter:Function = param2;
  28.          var bindings:Array = param3;
  29.          var watchers:Array = param4;
  30.          watchers[2] = new StaticPropertyWatcher("application",null,[bindings[1]],null);
  31.          watchers[3] = new PropertyWatcher("currentErrorMsg",null,[bindings[1]],null);
  32.          watchers[0] = new PropertyWatcher("resourceManager",{"unused":true},[bindings[2],bindings[0]],propertyGetter);
  33.          watchers[4] = new FunctionReturnWatcher("getString",target,function():Array
  34.          {
  35.             return ["alerts","CLOSE"];
  36.          },{"change":true},[bindings[2]],null);
  37.          watchers[1] = new FunctionReturnWatcher("getString",target,function():Array
  38.          {
  39.             return ["alerts","THERE_WAS_A_PROBLEM"];
  40.          },{"change":true},[bindings[0]],null);
  41.          watchers[2].updateParent(Application);
  42.          watchers[2].addChild(watchers[3]);
  43.          watchers[0].updateParent(target);
  44.          watchers[4].parentWatcher = watchers[0];
  45.          watchers[0].addChild(watchers[4]);
  46.          watchers[1].parentWatcher = watchers[0];
  47.          watchers[0].addChild(watchers[1]);
  48.       }
  49.    }
  50. }
  51.  
  52.