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

  1. package mx.effects
  2. {
  3.    import flash.events.EventDispatcher;
  4.    import mx.core.mx_internal;
  5.    import mx.effects.effectClasses.MaskEffectInstance;
  6.    import mx.events.TweenEvent;
  7.    
  8.    use namespace mx_internal;
  9.    
  10.    public class MaskEffect extends Effect
  11.    {
  12.       mx_internal static const VERSION:String = "4.5.0.20967";
  13.       
  14.       private static var AFFECTED_PROPERTIES:Array = ["visible"];
  15.       
  16.       public var createMaskFunction:Function;
  17.       
  18.       public var moveEasingFunction:Function;
  19.       
  20.       mx_internal var persistAfterEnd:Boolean = false;
  21.       
  22.       public var scaleEasingFunction:Function;
  23.       
  24.       public var scaleXFrom:Number;
  25.       
  26.       public var scaleXTo:Number;
  27.       
  28.       public var scaleYFrom:Number;
  29.       
  30.       public var scaleYTo:Number;
  31.       
  32.       private var _showTarget:Boolean = true;
  33.       
  34.       private var _showExplicitlySet:Boolean = false;
  35.       
  36.       public var xFrom:Number;
  37.       
  38.       public var xTo:Number;
  39.       
  40.       public var yFrom:Number;
  41.       
  42.       public var yTo:Number;
  43.       
  44.       public function MaskEffect(param1:Object = null)
  45.       {
  46.          super(param1);
  47.          instanceClass = MaskEffectInstance;
  48.          this.hideFocusRing = true;
  49.       }
  50.       
  51.       public function get showTarget() : Boolean
  52.       {
  53.          return this._showTarget;
  54.       }
  55.       
  56.       public function set showTarget(param1:Boolean) : void
  57.       {
  58.          this._showTarget = param1;
  59.          this._showExplicitlySet = true;
  60.       }
  61.       
  62.       override public function set hideFocusRing(param1:Boolean) : void
  63.       {
  64.          super.hideFocusRing = param1;
  65.       }
  66.       
  67.       override public function get hideFocusRing() : Boolean
  68.       {
  69.          return super.hideFocusRing;
  70.       }
  71.       
  72.       override public function getAffectedProperties() : Array
  73.       {
  74.          return AFFECTED_PROPERTIES;
  75.       }
  76.       
  77.       override protected function initInstance(param1:IEffectInstance) : void
  78.       {
  79.          var _loc2_:MaskEffectInstance = null;
  80.          super.initInstance(param1);
  81.          _loc2_ = MaskEffectInstance(param1);
  82.          if(this._showExplicitlySet)
  83.          {
  84.             _loc2_.showTarget = this.showTarget;
  85.          }
  86.          _loc2_.xFrom = this.xFrom;
  87.          _loc2_.yFrom = this.yFrom;
  88.          _loc2_.xTo = this.xTo;
  89.          _loc2_.yTo = this.yTo;
  90.          _loc2_.scaleXFrom = this.scaleXFrom;
  91.          _loc2_.scaleXTo = this.scaleXTo;
  92.          _loc2_.scaleYFrom = this.scaleYFrom;
  93.          _loc2_.scaleYTo = this.scaleYTo;
  94.          _loc2_.moveEasingFunction = this.moveEasingFunction;
  95.          _loc2_.scaleEasingFunction = this.scaleEasingFunction;
  96.          _loc2_.createMaskFunction = this.createMaskFunction;
  97.          _loc2_.mx_internal::persistAfterEnd = this.mx_internal::persistAfterEnd;
  98.          EventDispatcher(_loc2_).addEventListener(TweenEvent.TWEEN_START,this.tweenEventHandler);
  99.          EventDispatcher(_loc2_).addEventListener(TweenEvent.TWEEN_UPDATE,this.tweenEventHandler);
  100.          EventDispatcher(_loc2_).addEventListener(TweenEvent.TWEEN_END,this.tweenEventHandler);
  101.       }
  102.       
  103.       protected function tweenEventHandler(param1:TweenEvent) : void
  104.       {
  105.          dispatchEvent(param1);
  106.       }
  107.    }
  108. }
  109.  
  110.