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

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