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

  1. package
  2. {
  3.    import com.flex.ParentalControl;
  4.    import flash.display.Sprite;
  5.    import mx.binding.FunctionReturnWatcher;
  6.    import mx.binding.IWatcherSetupUtil;
  7.    import mx.binding.PropertyWatcher;
  8.    import mx.core.IFlexModuleFactory;
  9.    
  10.    public class _com_flex_ParentalControlWatcherSetupUtil extends Sprite implements IWatcherSetupUtil
  11.    {
  12.       public function _com_flex_ParentalControlWatcherSetupUtil()
  13.       {
  14.          super();
  15.       }
  16.       
  17.       public static function init(param1:IFlexModuleFactory) : void
  18.       {
  19.          ParentalControl.watcherSetupUtil = new _com_flex_ParentalControlWatcherSetupUtil();
  20.       }
  21.       
  22.       public function setup(param1:Object, param2:Function, param3:Array, param4:Array) : void
  23.       {
  24.          var target:Object = param1;
  25.          var propertyGetter:Function = param2;
  26.          var bindings:Array = param3;
  27.          var watchers:Array = param4;
  28.          watchers[7] = new PropertyWatcher("html",{"propertyChange":true},[bindings[4]],propertyGetter);
  29.          watchers[8] = new PropertyWatcher("location",{"locationChange":true},[bindings[4]],null);
  30.          watchers[4] = new PropertyWatcher("resourceManager",{"unused":true},[bindings[2],bindings[3],bindings[5]],propertyGetter);
  31.          watchers[9] = new FunctionReturnWatcher("getString",target,function():Array
  32.          {
  33.             return ["parentalControl","EXIT"];
  34.          },{"change":true},[bindings[5]],null);
  35.          watchers[6] = new FunctionReturnWatcher("getString",target,function():Array
  36.          {
  37.             return ["parentalControl","FORWARD"];
  38.          },{"change":true},[bindings[3]],null);
  39.          watchers[5] = new FunctionReturnWatcher("getString",target,function():Array
  40.          {
  41.             return ["parentalControl","BACK"];
  42.          },{"change":true},[bindings[2]],null);
  43.          watchers[0] = new PropertyWatcher("parentDocument",{"initialize":true},[bindings[1],bindings[0]],propertyGetter);
  44.          watchers[1] = new PropertyWatcher("nativeWindow",null,[bindings[1],bindings[0]],null);
  45.          watchers[2] = new PropertyWatcher("width",null,[bindings[0]],null);
  46.          watchers[3] = new PropertyWatcher("height",null,[bindings[1]],null);
  47.          watchers[7].updateParent(target);
  48.          watchers[7].addChild(watchers[8]);
  49.          watchers[4].updateParent(target);
  50.          watchers[9].parentWatcher = watchers[4];
  51.          watchers[4].addChild(watchers[9]);
  52.          watchers[6].parentWatcher = watchers[4];
  53.          watchers[4].addChild(watchers[6]);
  54.          watchers[5].parentWatcher = watchers[4];
  55.          watchers[4].addChild(watchers[5]);
  56.          watchers[0].updateParent(target);
  57.          watchers[0].addChild(watchers[1]);
  58.          watchers[1].addChild(watchers[2]);
  59.          watchers[1].addChild(watchers[3]);
  60.       }
  61.    }
  62. }
  63.  
  64.