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

  1. package
  2. {
  3.    import com.flex.steps.Welcome;
  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_steps_WelcomeWatcherSetupUtil extends Sprite implements IWatcherSetupUtil
  11.    {
  12.       public function _com_flex_steps_WelcomeWatcherSetupUtil()
  13.       {
  14.          super();
  15.       }
  16.       
  17.       public static function init(param1:IFlexModuleFactory) : void
  18.       {
  19.          Welcome.watcherSetupUtil = new _com_flex_steps_WelcomeWatcherSetupUtil();
  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[2] = new PropertyWatcher("locales",{"propertyChange":true},[bindings[1]],propertyGetter);
  29.          watchers[0] = new PropertyWatcher("resourceManager",{"unused":true},[bindings[2],bindings[4],bindings[3],bindings[5],bindings[0]],propertyGetter);
  30.          watchers[4] = new FunctionReturnWatcher("getString",target,function():Array
  31.          {
  32.             return ["welcome","WELCOME_TEXT"];
  33.          },{"change":true},[bindings[3]],null);
  34.          watchers[6] = new FunctionReturnWatcher("getString",target,function():Array
  35.          {
  36.             return ["welcome","CONTINUE"];
  37.          },{"change":true},[bindings[5]],null);
  38.          watchers[1] = new FunctionReturnWatcher("getString",target,function():Array
  39.          {
  40.             return ["welcome","CHANGE_LANGUAGE"];
  41.          },{"change":true},[bindings[0]],null);
  42.          watchers[3] = new FunctionReturnWatcher("getString",target,function():Array
  43.          {
  44.             return ["welcome","WELCOME_TITLE"];
  45.          },{"change":true},[bindings[2]],null);
  46.          watchers[5] = new FunctionReturnWatcher("getString",target,function():Array
  47.          {
  48.             return ["welcome","AGREE"];
  49.          },{"change":true},[bindings[4]],null);
  50.          watchers[2].updateParent(target);
  51.          watchers[0].updateParent(target);
  52.          watchers[4].parentWatcher = watchers[0];
  53.          watchers[0].addChild(watchers[4]);
  54.          watchers[6].parentWatcher = watchers[0];
  55.          watchers[0].addChild(watchers[6]);
  56.          watchers[1].parentWatcher = watchers[0];
  57.          watchers[0].addChild(watchers[1]);
  58.          watchers[3].parentWatcher = watchers[0];
  59.          watchers[0].addChild(watchers[3]);
  60.          watchers[5].parentWatcher = watchers[0];
  61.          watchers[0].addChild(watchers[5]);
  62.       }
  63.    }
  64. }
  65.  
  66.