home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 January / ME_2012_01.iso / Galileo-Video / system / ChromeLinux.swf / scripts / com / greensock / plugins / AutoAlphaPlugin.as next >
Encoding:
Text File  |  2010-11-16  |  1.1 KB  |  44 lines

  1. package com.greensock.plugins
  2. {
  3.    import com.greensock.*;
  4.    
  5.    public class AutoAlphaPlugin extends TweenPlugin
  6.    {
  7.       public static const API:Number = 1;
  8.       
  9.       protected var _target:Object;
  10.       
  11.       protected var _ignoreVisible:Boolean;
  12.       
  13.       public function AutoAlphaPlugin()
  14.       {
  15.          super();
  16.          this.propName = "autoAlpha";
  17.          this.overwriteProps = ["alpha","visible"];
  18.       }
  19.       
  20.       override public function killProps(param1:Object) : void
  21.       {
  22.          super.killProps(param1);
  23.          _ignoreVisible = Boolean("visible" in param1);
  24.       }
  25.       
  26.       override public function onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
  27.       {
  28.          _target = param1;
  29.          addTween(param1,"alpha",param1.alpha,param2,"alpha");
  30.          return true;
  31.       }
  32.       
  33.       override public function set changeFactor(param1:Number) : void
  34.       {
  35.          updateTweens(param1);
  36.          if(!_ignoreVisible)
  37.          {
  38.             _target.visible = Boolean(_target.alpha != 0);
  39.          }
  40.       }
  41.    }
  42. }
  43.  
  44.