home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 April / ME_04_2012.iso / Video-Tutorial / iPhoto / media / player.swf / scripts / mx / effects / Effect.as < prev    next >
Encoding:
Text File  |  2011-11-11  |  31.6 KB  |  957 lines

  1. package mx.effects
  2. {
  3.    import flash.events.Event;
  4.    import flash.events.EventDispatcher;
  5.    import mx.core.FlexVersion;
  6.    import mx.core.IFlexDisplayObject;
  7.    import mx.core.mx_internal;
  8.    import mx.effects.effectClasses.AddRemoveEffectTargetFilter;
  9.    import mx.effects.effectClasses.HideShowEffectTargetFilter;
  10.    import mx.effects.effectClasses.PropertyChanges;
  11.    import mx.events.EffectEvent;
  12.    import mx.managers.LayoutManager;
  13.    import mx.styles.IStyleClient;
  14.    import mx.utils.NameUtil;
  15.    
  16.    use namespace mx_internal;
  17.    
  18.    public class Effect extends EventDispatcher implements IEffect
  19.    {
  20.       mx_internal static const VERSION:String = "4.5.0.20967";
  21.       
  22.       mx_internal var applyEndValuesWhenDone:Boolean = false;
  23.       
  24.       private var _transitionInterruption:Boolean = false;
  25.       
  26.       protected var applyTransitionEndProperties:Boolean = FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0 ? false : true;
  27.       
  28.       private var _instances:Array = [];
  29.       
  30.       private var _callValidateNow:Boolean = false;
  31.       
  32.       private var isPaused:Boolean = false;
  33.       
  34.       mx_internal var filterObject:EffectTargetFilter;
  35.       
  36.       mx_internal var applyActualDimensions:Boolean = true;
  37.       
  38.       mx_internal var propertyChangesArray:Array;
  39.       
  40.       mx_internal var playReversed:Boolean;
  41.       
  42.       private var effectStopped:Boolean;
  43.       
  44.       mx_internal var parentCompositeEffect:Effect;
  45.       
  46.       private var _customFilter:EffectTargetFilter;
  47.       
  48.       private var _duration:Number = 500;
  49.       
  50.       mx_internal var durationExplicitlySet:Boolean = false;
  51.       
  52.       private var _effectTargetHost:IEffectTargetHost;
  53.       
  54.       protected var endValuesCaptured:Boolean = false;
  55.       
  56.       private var _filter:String;
  57.       
  58.       private var _hideFocusRing:Boolean = false;
  59.       
  60.       public var instanceClass:Class = IEffectInstance;
  61.       
  62.       private var _perElementOffset:Number = 0;
  63.       
  64.       private var _relevantProperties:Array;
  65.       
  66.       private var _relevantStyles:Array = [];
  67.       
  68.       public var repeatCount:int = 1;
  69.       
  70.       public var repeatDelay:int = 0;
  71.       
  72.       public var startDelay:int = 0;
  73.       
  74.       public var suspendBackgroundProcessing:Boolean = false;
  75.       
  76.       private var _targets:Array = [];
  77.       
  78.       private var _triggerEvent:Event;
  79.       
  80.       private var _playheadTime:Number = 0;
  81.       
  82.       public function Effect(param1:Object = null)
  83.       {
  84.          super();
  85.          this.target = param1;
  86.       }
  87.       
  88.       private static function mergeArrays(param1:Array, param2:Array) : Array
  89.       {
  90.          var _loc3_:int = 0;
  91.          var _loc4_:Boolean = false;
  92.          var _loc5_:int = 0;
  93.          if(param2)
  94.          {
  95.             _loc3_ = 0;
  96.             while(_loc3_ < param2.length)
  97.             {
  98.                _loc4_ = true;
  99.                _loc5_ = 0;
  100.                while(_loc5_ < param1.length)
  101.                {
  102.                   if(param1[_loc5_] == param2[_loc3_])
  103.                   {
  104.                      _loc4_ = false;
  105.                      break;
  106.                   }
  107.                   _loc5_++;
  108.                }
  109.                if(_loc4_)
  110.                {
  111.                   param1.push(param2[_loc3_]);
  112.                }
  113.                _loc3_++;
  114.             }
  115.          }
  116.          return param1;
  117.       }
  118.       
  119.       private static function stripUnchangedValues(param1:Array) : Array
  120.       {
  121.          var _loc3_:Object = null;
  122.          var _loc2_:int = 0;
  123.          while(_loc2_ < param1.length)
  124.          {
  125.             if(param1[_loc2_].stripUnchangedValues != false)
  126.             {
  127.                for(_loc3_ in param1[_loc2_].start)
  128.                {
  129.                   if(param1[_loc2_].start[_loc3_] == param1[_loc2_].end[_loc3_] || typeof param1[_loc2_].start[_loc3_] == "number" && typeof param1[_loc2_].end[_loc3_] == "number" && isNaN(param1[_loc2_].start[_loc3_]) && isNaN(param1[_loc2_].end[_loc3_]))
  130.                   {
  131.                      delete param1[_loc2_].start[_loc3_];
  132.                      delete param1[_loc2_].end[_loc3_];
  133.                   }
  134.                }
  135.             }
  136.             _loc2_++;
  137.          }
  138.          return param1;
  139.       }
  140.       
  141.       mx_internal function get transitionInterruption() : Boolean
  142.       {
  143.          return this._transitionInterruption;
  144.       }
  145.       
  146.       mx_internal function set transitionInterruption(param1:Boolean) : void
  147.       {
  148.          this._transitionInterruption = param1;
  149.       }
  150.       
  151.       public function get className() : String
  152.       {
  153.          return NameUtil.getUnqualifiedClassName(this);
  154.       }
  155.       
  156.       public function get customFilter() : EffectTargetFilter
  157.       {
  158.          return this._customFilter;
  159.       }
  160.       
  161.       public function set customFilter(param1:EffectTargetFilter) : void
  162.       {
  163.          this._customFilter = param1;
  164.          this.mx_internal::filterObject = param1;
  165.       }
  166.       
  167.       public function get duration() : Number
  168.       {
  169.          if(!this.mx_internal::durationExplicitlySet && Boolean(this.mx_internal::parentCompositeEffect))
  170.          {
  171.             return this.mx_internal::parentCompositeEffect.duration;
  172.          }
  173.          return this._duration;
  174.       }
  175.       
  176.       public function set duration(param1:Number) : void
  177.       {
  178.          this.mx_internal::durationExplicitlySet = true;
  179.          this._duration = param1;
  180.       }
  181.       
  182.       public function get effectTargetHost() : IEffectTargetHost
  183.       {
  184.          return this._effectTargetHost;
  185.       }
  186.       
  187.       public function set effectTargetHost(param1:IEffectTargetHost) : void
  188.       {
  189.          this._effectTargetHost = param1;
  190.       }
  191.       
  192.       public function get filter() : String
  193.       {
  194.          return this._filter;
  195.       }
  196.       
  197.       public function set filter(param1:String) : void
  198.       {
  199.          if(!this.customFilter)
  200.          {
  201.             this._filter = param1;
  202.             switch(param1)
  203.             {
  204.                case "add":
  205.                case "remove":
  206.                   this.mx_internal::filterObject = new AddRemoveEffectTargetFilter();
  207.                   AddRemoveEffectTargetFilter(this.mx_internal::filterObject).add = param1 == "add";
  208.                   break;
  209.                case "hide":
  210.                case "show":
  211.                   this.mx_internal::filterObject = new HideShowEffectTargetFilter();
  212.                   HideShowEffectTargetFilter(this.mx_internal::filterObject).show = param1 == "show";
  213.                   break;
  214.                case "move":
  215.                   this.mx_internal::filterObject = new EffectTargetFilter();
  216.                   this.mx_internal::filterObject.filterProperties = ["x","y"];
  217.                   break;
  218.                case "resize":
  219.                   this.mx_internal::filterObject = new EffectTargetFilter();
  220.                   this.mx_internal::filterObject.filterProperties = ["width","height"];
  221.                   break;
  222.                case "addItem":
  223.                   this.mx_internal::filterObject = new EffectTargetFilter();
  224.                   this.mx_internal::filterObject.requiredSemantics = {"added":true};
  225.                   break;
  226.                case "removeItem":
  227.                   this.mx_internal::filterObject = new EffectTargetFilter();
  228.                   this.mx_internal::filterObject.requiredSemantics = {"removed":true};
  229.                   break;
  230.                case "replacedItem":
  231.                   this.mx_internal::filterObject = new EffectTargetFilter();
  232.                   this.mx_internal::filterObject.requiredSemantics = {"replaced":true};
  233.                   break;
  234.                case "replacementItem":
  235.                   this.mx_internal::filterObject = new EffectTargetFilter();
  236.                   this.mx_internal::filterObject.requiredSemantics = {"replacement":true};
  237.                   break;
  238.                default:
  239.                   this.mx_internal::filterObject = null;
  240.             }
  241.          }
  242.       }
  243.       
  244.       public function get hideFocusRing() : Boolean
  245.       {
  246.          return this._hideFocusRing;
  247.       }
  248.       
  249.       public function set hideFocusRing(param1:Boolean) : void
  250.       {
  251.          this._hideFocusRing = param1;
  252.       }
  253.       
  254.       public function get isPlaying() : Boolean
  255.       {
  256.          return Boolean(this._instances) && this._instances.length > 0;
  257.       }
  258.       
  259.       public function get perElementOffset() : Number
  260.       {
  261.          return this._perElementOffset;
  262.       }
  263.       
  264.       public function set perElementOffset(param1:Number) : void
  265.       {
  266.          this._perElementOffset = param1;
  267.       }
  268.       
  269.       public function get relevantProperties() : Array
  270.       {
  271.          if(this._relevantProperties)
  272.          {
  273.             return this._relevantProperties;
  274.          }
  275.          return this.getAffectedProperties();
  276.       }
  277.       
  278.       public function set relevantProperties(param1:Array) : void
  279.       {
  280.          this._relevantProperties = param1;
  281.       }
  282.       
  283.       public function get relevantStyles() : Array
  284.       {
  285.          return this._relevantStyles;
  286.       }
  287.       
  288.       public function set relevantStyles(param1:Array) : void
  289.       {
  290.          this._relevantStyles = param1;
  291.       }
  292.       
  293.       public function get target() : Object
  294.       {
  295.          if(this._targets.length > 0)
  296.          {
  297.             return this._targets[0];
  298.          }
  299.          return null;
  300.       }
  301.       
  302.       public function set target(param1:Object) : void
  303.       {
  304.          this._targets.splice(0);
  305.          if(param1)
  306.          {
  307.             this._targets[0] = param1;
  308.          }
  309.       }
  310.       
  311.       public function get targets() : Array
  312.       {
  313.          return this._targets;
  314.       }
  315.       
  316.       public function set targets(param1:Array) : void
  317.       {
  318.          var _loc2_:int = int(param1.length);
  319.          var _loc3_:int = _loc2_ - 1;
  320.          while(_loc3_ >= 0)
  321.          {
  322.             if(param1[_loc3_] == null)
  323.             {
  324.                param1.splice(_loc3_,1);
  325.             }
  326.             _loc3_--;
  327.          }
  328.          this._targets = param1;
  329.       }
  330.       
  331.       public function get triggerEvent() : Event
  332.       {
  333.          return this._triggerEvent;
  334.       }
  335.       
  336.       public function set triggerEvent(param1:Event) : void
  337.       {
  338.          this._triggerEvent = param1;
  339.       }
  340.       
  341.       public function get playheadTime() : Number
  342.       {
  343.          var _loc1_:int = 0;
  344.          while(_loc1_ < this._instances.length)
  345.          {
  346.             if(this._instances[_loc1_])
  347.             {
  348.                return IEffectInstance(this._instances[_loc1_]).playheadTime;
  349.             }
  350.             _loc1_++;
  351.          }
  352.          return this._playheadTime;
  353.       }
  354.       
  355.       public function set playheadTime(param1:Number) : void
  356.       {
  357.          var _loc2_:Boolean = false;
  358.          if(this._instances.length == 0)
  359.          {
  360.             this.play();
  361.             _loc2_ = true;
  362.          }
  363.          var _loc3_:int = 0;
  364.          while(_loc3_ < this._instances.length)
  365.          {
  366.             if(this._instances[_loc3_])
  367.             {
  368.                EffectInstance(this._instances[_loc3_]).playheadTime = param1;
  369.             }
  370.             _loc3_++;
  371.          }
  372.          if(_loc2_)
  373.          {
  374.             this.pause();
  375.          }
  376.          this._playheadTime = param1;
  377.       }
  378.       
  379.       public function getAffectedProperties() : Array
  380.       {
  381.          return [];
  382.       }
  383.       
  384.       public function createInstances(param1:Array = null) : Array
  385.       {
  386.          var _loc6_:IEffectInstance = null;
  387.          if(!param1)
  388.          {
  389.             param1 = this.targets;
  390.          }
  391.          var _loc2_:Array = [];
  392.          var _loc3_:int = int(param1.length);
  393.          var _loc4_:Number = 0;
  394.          var _loc5_:int = 0;
  395.          while(_loc5_ < _loc3_)
  396.          {
  397.             _loc6_ = this.createInstance(param1[_loc5_]);
  398.             if(_loc6_)
  399.             {
  400.                _loc6_.startDelay += _loc4_;
  401.                _loc4_ += this.perElementOffset;
  402.                _loc2_.push(_loc6_);
  403.             }
  404.             _loc5_++;
  405.          }
  406.          this.triggerEvent = null;
  407.          return _loc2_;
  408.       }
  409.       
  410.       public function createInstance(param1:Object = null) : IEffectInstance
  411.       {
  412.          var _loc6_:int = 0;
  413.          var _loc7_:int = 0;
  414.          if(!param1)
  415.          {
  416.             param1 = this.target;
  417.          }
  418.          var _loc2_:IEffectInstance = null;
  419.          var _loc3_:PropertyChanges = null;
  420.          var _loc4_:Boolean = true;
  421.          var _loc5_:Boolean = false;
  422.          if(this.mx_internal::propertyChangesArray)
  423.          {
  424.             _loc5_ = true;
  425.             _loc4_ = this.filterInstance(this.mx_internal::propertyChangesArray,param1);
  426.          }
  427.          if(_loc4_)
  428.          {
  429.             _loc2_ = IEffectInstance(new this.instanceClass(param1));
  430.             this.initInstance(_loc2_);
  431.             if(_loc5_)
  432.             {
  433.                _loc6_ = int(this.mx_internal::propertyChangesArray.length);
  434.                _loc7_ = 0;
  435.                while(_loc7_ < _loc6_)
  436.                {
  437.                   if(this.mx_internal::propertyChangesArray[_loc7_].target == param1)
  438.                   {
  439.                      _loc2_.propertyChanges = this.mx_internal::propertyChangesArray[_loc7_];
  440.                   }
  441.                   _loc7_++;
  442.                }
  443.             }
  444.             EventDispatcher(_loc2_).addEventListener(EffectEvent.EFFECT_START,this.effectStartHandler);
  445.             EventDispatcher(_loc2_).addEventListener(EffectEvent.EFFECT_STOP,this.effectStopHandler);
  446.             EventDispatcher(_loc2_).addEventListener(EffectEvent.EFFECT_END,this.effectEndHandler);
  447.             this._instances.push(_loc2_);
  448.             if(this.triggerEvent)
  449.             {
  450.                _loc2_.initEffect(this.triggerEvent);
  451.             }
  452.          }
  453.          return _loc2_;
  454.       }
  455.       
  456.       protected function initInstance(param1:IEffectInstance) : void
  457.       {
  458.          param1.duration = this.duration;
  459.          Object(param1).durationExplicitlySet = this.mx_internal::durationExplicitlySet;
  460.          param1.effect = this;
  461.          param1.effectTargetHost = this.effectTargetHost;
  462.          param1.hideFocusRing = this.hideFocusRing;
  463.          param1.repeatCount = this.repeatCount;
  464.          param1.repeatDelay = this.repeatDelay;
  465.          param1.startDelay = this.startDelay;
  466.          param1.suspendBackgroundProcessing = this.suspendBackgroundProcessing;
  467.       }
  468.       
  469.       public function deleteInstance(param1:IEffectInstance) : void
  470.       {
  471.          EventDispatcher(param1).removeEventListener(EffectEvent.EFFECT_START,this.effectStartHandler);
  472.          EventDispatcher(param1).removeEventListener(EffectEvent.EFFECT_STOP,this.effectStopHandler);
  473.          EventDispatcher(param1).removeEventListener(EffectEvent.EFFECT_END,this.effectEndHandler);
  474.          var _loc2_:int = int(this._instances.length);
  475.          var _loc3_:int = 0;
  476.          while(_loc3_ < _loc2_)
  477.          {
  478.             if(this._instances[_loc3_] === param1)
  479.             {
  480.                this._instances.splice(_loc3_,1);
  481.             }
  482.             _loc3_++;
  483.          }
  484.       }
  485.       
  486.       public function play(param1:Array = null, param2:Boolean = false) : Array
  487.       {
  488.          var _loc6_:int = 0;
  489.          var _loc7_:Object = null;
  490.          var _loc8_:IEffectInstance = null;
  491.          this.effectStopped = false;
  492.          this.isPaused = false;
  493.          this.mx_internal::playReversed = param2;
  494.          if(param1 == null && this.mx_internal::propertyChangesArray != null)
  495.          {
  496.             if(this._callValidateNow)
  497.             {
  498.                LayoutManager.getInstance().validateNow();
  499.             }
  500.             if(!this.endValuesCaptured)
  501.             {
  502.                this.mx_internal::propertyChangesArray = this.mx_internal::captureValues(this.mx_internal::propertyChangesArray,false);
  503.             }
  504.             this.mx_internal::propertyChangesArray = stripUnchangedValues(this.mx_internal::propertyChangesArray);
  505.             this.mx_internal::applyStartValues(this.mx_internal::propertyChangesArray,this.targets);
  506.             if(param2)
  507.             {
  508.                _loc6_ = 0;
  509.                while(_loc6_ < this.mx_internal::propertyChangesArray.length)
  510.                {
  511.                   _loc7_ = this.mx_internal::propertyChangesArray[_loc6_].start;
  512.                   this.mx_internal::propertyChangesArray[_loc6_].start = this.mx_internal::propertyChangesArray[_loc6_].end;
  513.                   this.mx_internal::propertyChangesArray[_loc6_].end = _loc7_;
  514.                   _loc6_++;
  515.                }
  516.             }
  517.             LayoutManager.getInstance().validateNow();
  518.             this.mx_internal::applyEndValuesWhenDone = true;
  519.          }
  520.          var _loc3_:Array = this.createInstances(param1);
  521.          var _loc4_:int = int(_loc3_.length);
  522.          var _loc5_:int = 0;
  523.          while(_loc5_ < _loc4_)
  524.          {
  525.             _loc8_ = IEffectInstance(_loc3_[_loc5_]);
  526.             Object(_loc8_).playReversed = param2;
  527.             _loc8_.startEffect();
  528.             _loc5_++;
  529.          }
  530.          return _loc3_;
  531.       }
  532.       
  533.       public function pause() : void
  534.       {
  535.          var _loc1_:int = 0;
  536.          var _loc2_:int = 0;
  537.          if(this.isPlaying && !this.isPaused)
  538.          {
  539.             this.isPaused = true;
  540.             _loc1_ = int(this._instances.length);
  541.             _loc2_ = 0;
  542.             while(_loc2_ < _loc1_)
  543.             {
  544.                IEffectInstance(this._instances[_loc2_]).pause();
  545.                _loc2_++;
  546.             }
  547.          }
  548.       }
  549.       
  550.       public function stop() : void
  551.       {
  552.          var _loc3_:IEffectInstance = null;
  553.          var _loc1_:int = int(this._instances.length - 1);
  554.          var _loc2_:int = _loc1_;
  555.          while(_loc2_ >= 0)
  556.          {
  557.             _loc3_ = IEffectInstance(this._instances[_loc2_]);
  558.             if(_loc3_)
  559.             {
  560.                _loc3_.stop();
  561.             }
  562.             _loc2_--;
  563.          }
  564.       }
  565.       
  566.       public function resume() : void
  567.       {
  568.          var _loc1_:int = 0;
  569.          var _loc2_:int = 0;
  570.          if(this.isPlaying && this.isPaused)
  571.          {
  572.             this.isPaused = false;
  573.             _loc1_ = int(this._instances.length);
  574.             _loc2_ = 0;
  575.             while(_loc2_ < _loc1_)
  576.             {
  577.                IEffectInstance(this._instances[_loc2_]).resume();
  578.                _loc2_++;
  579.             }
  580.          }
  581.       }
  582.       
  583.       public function reverse() : void
  584.       {
  585.          var _loc1_:int = 0;
  586.          var _loc2_:int = 0;
  587.          if(this.isPlaying)
  588.          {
  589.             _loc1_ = int(this._instances.length);
  590.             _loc2_ = 0;
  591.             while(_loc2_ < _loc1_)
  592.             {
  593.                IEffectInstance(this._instances[_loc2_]).reverse();
  594.                _loc2_++;
  595.             }
  596.          }
  597.       }
  598.       
  599.       public function end(param1:IEffectInstance = null) : void
  600.       {
  601.          var _loc2_:int = 0;
  602.          var _loc3_:int = 0;
  603.          var _loc4_:IEffectInstance = null;
  604.          if(param1)
  605.          {
  606.             param1.end();
  607.          }
  608.          else
  609.          {
  610.             _loc2_ = int(this._instances.length);
  611.             _loc3_ = _loc2_ - 1;
  612.             while(_loc3_ >= 0)
  613.             {
  614.                _loc4_ = IEffectInstance(this._instances[_loc3_]);
  615.                if(_loc4_)
  616.                {
  617.                   _loc4_.end();
  618.                }
  619.                _loc3_--;
  620.             }
  621.          }
  622.       }
  623.       
  624.       protected function filterInstance(param1:Array, param2:Object) : Boolean
  625.       {
  626.          if(this.mx_internal::filterObject)
  627.          {
  628.             return this.mx_internal::filterObject.filterInstance(param1,this.effectTargetHost,param2);
  629.          }
  630.          return true;
  631.       }
  632.       
  633.       public function captureStartValues() : void
  634.       {
  635.          if(this.targets.length > 0)
  636.          {
  637.             this.mx_internal::propertyChangesArray = this.mx_internal::captureValues(null,true);
  638.             this._callValidateNow = true;
  639.          }
  640.          this.endValuesCaptured = false;
  641.       }
  642.       
  643.       public function captureMoreStartValues(param1:Array) : void
  644.       {
  645.          var _loc2_:Array = null;
  646.          if(param1.length > 0)
  647.          {
  648.             _loc2_ = this.mx_internal::captureValues(null,true);
  649.             this.mx_internal::propertyChangesArray = this.mx_internal::propertyChangesArray != null ? this.mx_internal::propertyChangesArray.concat(_loc2_) : _loc2_;
  650.          }
  651.       }
  652.       
  653.       public function captureEndValues() : void
  654.       {
  655.          this.mx_internal::propertyChangesArray = this.mx_internal::captureValues(this.mx_internal::propertyChangesArray,false);
  656.          this.endValuesCaptured = true;
  657.       }
  658.       
  659.       mx_internal function captureValues(param1:Array, param2:Boolean, param3:Array = null) : Array
  660.       {
  661.          var _loc4_:int = 0;
  662.          var _loc5_:int = 0;
  663.          var _loc7_:Object = null;
  664.          var _loc8_:Object = null;
  665.          var _loc9_:int = 0;
  666.          var _loc10_:int = 0;
  667.          var _loc12_:* = undefined;
  668.          if(!param1)
  669.          {
  670.             param1 = [];
  671.             _loc4_ = int(this.targets.length);
  672.             _loc5_ = 0;
  673.             while(_loc5_ < _loc4_)
  674.             {
  675.                param1.push(new PropertyChanges(this.targets[_loc5_]));
  676.                _loc5_++;
  677.             }
  678.          }
  679.          var _loc6_:Array = !this.mx_internal::filterObject ? this.relevantProperties : mergeArrays(this.relevantProperties,this.mx_internal::filterObject.filterProperties);
  680.          if((Boolean(_loc6_)) && _loc6_.length > 0)
  681.          {
  682.             _loc4_ = int(param1.length);
  683.             _loc5_ = 0;
  684.             while(_loc5_ < _loc4_)
  685.             {
  686.                _loc8_ = param1[_loc5_].target;
  687.                if(param3 == null || param3.length == 0 || param3.indexOf(_loc8_) >= 0)
  688.                {
  689.                   _loc7_ = param2 ? param1[_loc5_].start : param1[_loc5_].end;
  690.                   _loc9_ = int(_loc6_.length);
  691.                   _loc10_ = 0;
  692.                   while(_loc10_ < _loc9_)
  693.                   {
  694.                      if(_loc7_[_loc6_[_loc10_]] === undefined)
  695.                      {
  696.                         _loc7_[_loc6_[_loc10_]] = this.getValueFromTarget(_loc8_,_loc6_[_loc10_]);
  697.                      }
  698.                      _loc10_++;
  699.                   }
  700.                }
  701.                _loc5_++;
  702.             }
  703.          }
  704.          var _loc11_:Array = !this.mx_internal::filterObject ? this.relevantStyles : mergeArrays(this.relevantStyles,this.mx_internal::filterObject.filterStyles);
  705.          if((Boolean(_loc11_)) && _loc11_.length > 0)
  706.          {
  707.             _loc4_ = int(param1.length);
  708.             _loc5_ = 0;
  709.             while(_loc5_ < _loc4_)
  710.             {
  711.                _loc8_ = param1[_loc5_].target;
  712.                if(param3 == null || param3.length == 0 || param3.indexOf(_loc8_) >= 0)
  713.                {
  714.                   if(_loc8_ is IStyleClient)
  715.                   {
  716.                      _loc7_ = param2 ? param1[_loc5_].start : param1[_loc5_].end;
  717.                      _loc9_ = int(_loc11_.length);
  718.                      _loc10_ = 0;
  719.                      while(_loc10_ < _loc9_)
  720.                      {
  721.                         if(_loc7_[_loc11_[_loc10_]] === undefined)
  722.                         {
  723.                            _loc12_ = _loc8_.getStyle(_loc11_[_loc10_]);
  724.                            _loc7_[_loc11_[_loc10_]] = _loc12_;
  725.                         }
  726.                         _loc10_++;
  727.                      }
  728.                   }
  729.                }
  730.                _loc5_++;
  731.             }
  732.          }
  733.          return param1;
  734.       }
  735.       
  736.       protected function getValueFromTarget(param1:Object, param2:String) : *
  737.       {
  738.          if(param2 in param1)
  739.          {
  740.             return param1[param2];
  741.          }
  742.          return undefined;
  743.       }
  744.       
  745.       mx_internal function applyStartValues(param1:Array, param2:Array) : void
  746.       {
  747.          var _loc6_:int = 0;
  748.          var _loc7_:int = 0;
  749.          var _loc8_:Object = null;
  750.          var _loc9_:Boolean = false;
  751.          var _loc10_:String = null;
  752.          var _loc11_:* = undefined;
  753.          var _loc12_:* = undefined;
  754.          var _loc13_:String = null;
  755.          var _loc14_:* = undefined;
  756.          var _loc15_:* = undefined;
  757.          var _loc3_:Array = this.relevantProperties;
  758.          var _loc4_:int = int(param1.length);
  759.          var _loc5_:int = 0;
  760.          while(_loc5_ < _loc4_)
  761.          {
  762.             _loc8_ = param1[_loc5_].target;
  763.             _loc9_ = false;
  764.             _loc6_ = int(param2.length);
  765.             _loc7_ = 0;
  766.             while(_loc7_ < _loc6_)
  767.             {
  768.                if(param2[_loc7_] == _loc8_)
  769.                {
  770.                   _loc9_ = this.filterInstance(param1,_loc8_);
  771.                   break;
  772.                }
  773.                _loc7_++;
  774.             }
  775.             if(_loc9_)
  776.             {
  777.                _loc6_ = int(_loc3_.length);
  778.                _loc7_ = 0;
  779.                while(_loc7_ < _loc6_)
  780.                {
  781.                   _loc10_ = _loc3_[_loc7_];
  782.                   _loc11_ = param1[_loc5_].start[_loc10_];
  783.                   _loc12_ = param1[_loc5_].end[_loc10_];
  784.                   if(_loc10_ in param1[_loc5_].start && _loc12_ != _loc11_ && (!(_loc11_ is Number) || !(isNaN(_loc12_) && isNaN(_loc11_))))
  785.                   {
  786.                      this.applyValueToTarget(_loc8_,_loc3_[_loc7_],param1[_loc5_].start[_loc3_[_loc7_]],param1[_loc5_].start);
  787.                   }
  788.                   _loc7_++;
  789.                }
  790.                _loc6_ = int(this.relevantStyles.length);
  791.                _loc7_ = 0;
  792.                while(_loc7_ < _loc6_)
  793.                {
  794.                   _loc13_ = this.relevantStyles[_loc7_];
  795.                   _loc14_ = param1[_loc5_].start[_loc13_];
  796.                   _loc15_ = param1[_loc5_].end[_loc13_];
  797.                   if(_loc13_ in param1[_loc5_].start && _loc15_ != _loc14_ && (!(_loc14_ is Number) || !(isNaN(_loc15_) && isNaN(_loc14_))) && _loc8_ is IStyleClient)
  798.                   {
  799.                      if(param1[_loc5_].end[this.relevantStyles[_loc7_]] !== undefined)
  800.                      {
  801.                         _loc8_.setStyle(this.relevantStyles[_loc7_],param1[_loc5_].start[this.relevantStyles[_loc7_]]);
  802.                      }
  803.                      else
  804.                      {
  805.                         _loc8_.clearStyle(this.relevantStyles[_loc7_]);
  806.                      }
  807.                   }
  808.                   _loc7_++;
  809.                }
  810.             }
  811.             _loc5_++;
  812.          }
  813.       }
  814.       
  815.       mx_internal function applyEndValues(param1:Array, param2:Array) : void
  816.       {
  817.          var _loc6_:int = 0;
  818.          var _loc7_:int = 0;
  819.          var _loc8_:Object = null;
  820.          var _loc9_:Boolean = false;
  821.          var _loc10_:String = null;
  822.          var _loc11_:* = undefined;
  823.          var _loc12_:* = undefined;
  824.          var _loc13_:String = null;
  825.          var _loc14_:* = undefined;
  826.          var _loc15_:* = undefined;
  827.          if(!this.applyTransitionEndProperties)
  828.          {
  829.             return;
  830.          }
  831.          var _loc3_:Array = this.relevantProperties;
  832.          var _loc4_:int = int(param1.length);
  833.          var _loc5_:int = 0;
  834.          while(_loc5_ < _loc4_)
  835.          {
  836.             _loc8_ = param1[_loc5_].target;
  837.             _loc9_ = false;
  838.             _loc6_ = int(param2.length);
  839.             _loc7_ = 0;
  840.             while(_loc7_ < _loc6_)
  841.             {
  842.                if(param2[_loc7_] == _loc8_)
  843.                {
  844.                   _loc9_ = this.filterInstance(param1,_loc8_);
  845.                   break;
  846.                }
  847.                _loc7_++;
  848.             }
  849.             if(_loc9_)
  850.             {
  851.                _loc6_ = int(_loc3_.length);
  852.                _loc7_ = 0;
  853.                while(_loc7_ < _loc6_)
  854.                {
  855.                   _loc10_ = _loc3_[_loc7_];
  856.                   _loc11_ = param1[_loc5_].start[_loc10_];
  857.                   _loc12_ = param1[_loc5_].end[_loc10_];
  858.                   if(_loc10_ in param1[_loc5_].end && (!(_loc12_ is Number) || !(isNaN(_loc12_) && isNaN(_loc11_))))
  859.                   {
  860.                      this.applyValueToTarget(_loc8_,_loc10_,param1[_loc5_].end[_loc10_],param1[_loc5_].end);
  861.                   }
  862.                   _loc7_++;
  863.                }
  864.                _loc6_ = int(this.relevantStyles.length);
  865.                _loc7_ = 0;
  866.                while(_loc7_ < _loc6_)
  867.                {
  868.                   _loc13_ = this.relevantStyles[_loc7_];
  869.                   _loc14_ = param1[_loc5_].start[_loc13_];
  870.                   _loc15_ = param1[_loc5_].end[_loc13_];
  871.                   if(_loc13_ in param1[_loc5_].end && (!(_loc15_ is Number) || !(isNaN(_loc15_) && isNaN(_loc14_))) && _loc8_ is IStyleClient)
  872.                   {
  873.                      if(param1[_loc5_].end[_loc13_] !== undefined)
  874.                      {
  875.                         _loc8_.setStyle(_loc13_,param1[_loc5_].end[_loc13_]);
  876.                      }
  877.                      else
  878.                      {
  879.                         _loc8_.clearStyle(_loc13_);
  880.                      }
  881.                   }
  882.                   _loc7_++;
  883.                }
  884.             }
  885.             _loc5_++;
  886.          }
  887.       }
  888.       
  889.       protected function applyValueToTarget(param1:Object, param2:String, param3:*, param4:Object) : void
  890.       {
  891.          if(param2 in param1)
  892.          {
  893.             try
  894.             {
  895.                if(this.mx_internal::applyActualDimensions && param1 is IFlexDisplayObject && param2 == "height")
  896.                {
  897.                   param1.setActualSize(param1.width,param3);
  898.                }
  899.                else if(this.mx_internal::applyActualDimensions && param1 is IFlexDisplayObject && param2 == "width")
  900.                {
  901.                   param1.setActualSize(param3,param1.height);
  902.                }
  903.                else
  904.                {
  905.                   param1[param2] = param3;
  906.                }
  907.             }
  908.             catch(e:Error)
  909.             {
  910.             }
  911.          }
  912.       }
  913.       
  914.       protected function effectStartHandler(param1:EffectEvent) : void
  915.       {
  916.          dispatchEvent(param1);
  917.       }
  918.       
  919.       protected function effectStopHandler(param1:EffectEvent) : void
  920.       {
  921.          dispatchEvent(param1);
  922.          this.effectStopped = true;
  923.       }
  924.       
  925.       protected function effectEndHandler(param1:EffectEvent) : void
  926.       {
  927.          var _loc4_:int = 0;
  928.          var _loc5_:Object = null;
  929.          if(this.mx_internal::playReversed && this.mx_internal::propertyChangesArray != null)
  930.          {
  931.             _loc4_ = 0;
  932.             while(_loc4_ < this.mx_internal::propertyChangesArray.length)
  933.             {
  934.                _loc5_ = this.mx_internal::propertyChangesArray[_loc4_].start;
  935.                this.mx_internal::propertyChangesArray[_loc4_].start = this.mx_internal::propertyChangesArray[_loc4_].end;
  936.                this.mx_internal::propertyChangesArray[_loc4_].end = _loc5_;
  937.                _loc4_++;
  938.             }
  939.          }
  940.          var _loc2_:Boolean = !this._instances || this._instances.length == 1;
  941.          if(this.mx_internal::applyEndValuesWhenDone && !this.effectStopped && _loc2_)
  942.          {
  943.             this.mx_internal::applyEndValues(this.mx_internal::propertyChangesArray,this.targets);
  944.          }
  945.          var _loc3_:IEffectInstance = IEffectInstance(param1.effectInstance);
  946.          this.deleteInstance(_loc3_);
  947.          dispatchEvent(param1);
  948.          if(_loc2_)
  949.          {
  950.             this.mx_internal::propertyChangesArray = null;
  951.             this.mx_internal::applyEndValuesWhenDone = false;
  952.          }
  953.       }
  954.    }
  955. }
  956.  
  957.