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

  1. package com.greensock
  2. {
  3.    import com.greensock.core.*;
  4.    
  5.    public class OverwriteManager
  6.    {
  7.       public static var enabled:Boolean;
  8.       
  9.       public static var mode:int;
  10.       
  11.       public static const version:Number = 6.02;
  12.       
  13.       public static const NONE:int = 0;
  14.       
  15.       public static const ALL_IMMEDIATE:int = 1;
  16.       
  17.       public static const AUTO:int = 2;
  18.       
  19.       public static const CONCURRENT:int = 3;
  20.       
  21.       public static const ALL_ONSTART:int = 4;
  22.       
  23.       public static const PREEXISTING:int = 5;
  24.       
  25.       public function OverwriteManager()
  26.       {
  27.          super();
  28.       }
  29.       
  30.       public static function getGlobalPaused(param1:TweenCore) : Boolean
  31.       {
  32.          while(param1)
  33.          {
  34.             if(param1.cachedPaused)
  35.             {
  36.                return true;
  37.             }
  38.             param1 = param1.timeline;
  39.          }
  40.          return false;
  41.       }
  42.       
  43.       public static function init(param1:int = 2) : int
  44.       {
  45.          if(TweenLite.version < 11.1)
  46.          {
  47.             throw new Error("Warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
  48.          }
  49.          TweenLite.overwriteManager = OverwriteManager;
  50.          mode = param1;
  51.          enabled = true;
  52.          return mode;
  53.       }
  54.       
  55.       public static function manageOverwrites(param1:TweenLite, param2:Object, param3:Array, param4:uint) : Boolean
  56.       {
  57.          var _loc5_:int = 0;
  58.          var _loc6_:Boolean = false;
  59.          var _loc7_:TweenLite = null;
  60.          var _loc13_:uint = 0;
  61.          var _loc14_:Number = NaN;
  62.          var _loc15_:Number = NaN;
  63.          var _loc16_:TweenCore = null;
  64.          var _loc17_:Number = NaN;
  65.          var _loc18_:SimpleTimeline = null;
  66.          if(param4 >= 4)
  67.          {
  68.             _loc13_ = param3.length;
  69.             _loc5_ = 0;
  70.             while(_loc5_ < _loc13_)
  71.             {
  72.                _loc7_ = param3[_loc5_];
  73.                if(_loc7_ != param1)
  74.                {
  75.                   if(_loc7_.setEnabled(false,false))
  76.                   {
  77.                      _loc6_ = true;
  78.                   }
  79.                }
  80.                else if(param4 == 5)
  81.                {
  82.                   break;
  83.                }
  84.                _loc5_++;
  85.             }
  86.             return _loc6_;
  87.          }
  88.          var _loc8_:Number = param1.cachedStartTime + 1e-10;
  89.          var _loc9_:Array = [];
  90.          var _loc10_:Array = [];
  91.          var _loc11_:uint = 0;
  92.          var _loc12_:uint = 0;
  93.          _loc5_ = int(param3.length);
  94.          while(--_loc5_ > -1)
  95.          {
  96.             _loc7_ = param3[_loc5_];
  97.             if(!(_loc7_ == param1 || _loc7_.gc))
  98.             {
  99.                if(_loc7_.timeline != param1.timeline)
  100.                {
  101.                   if(!getGlobalPaused(_loc7_))
  102.                   {
  103.                      var _loc19_:*;
  104.                      _loc10_[_loc19_ = _loc11_++] = _loc7_;
  105.                   }
  106.                }
  107.                else if(_loc7_.cachedStartTime <= _loc8_ && _loc7_.cachedStartTime + _loc7_.totalDuration + 1e-10 > _loc8_ && !getGlobalPaused(_loc7_))
  108.                {
  109.                   _loc9_[_loc19_ = _loc12_++] = _loc7_;
  110.                }
  111.             }
  112.          }
  113.          if(_loc11_ != 0)
  114.          {
  115.             _loc14_ = param1.cachedTimeScale;
  116.             _loc15_ = _loc8_;
  117.             _loc18_ = param1.timeline;
  118.             while(_loc18_)
  119.             {
  120.                _loc14_ *= _loc18_.cachedTimeScale;
  121.                _loc15_ += _loc18_.cachedStartTime;
  122.                _loc18_ = _loc18_.timeline;
  123.             }
  124.             _loc8_ = _loc14_ * _loc15_;
  125.             _loc5_ = int(_loc11_);
  126.             while(--_loc5_ > -1)
  127.             {
  128.                _loc16_ = _loc10_[_loc5_];
  129.                _loc14_ = _loc16_.cachedTimeScale;
  130.                _loc15_ = _loc16_.cachedStartTime;
  131.                _loc18_ = _loc16_.timeline;
  132.                while(_loc18_)
  133.                {
  134.                   _loc14_ *= _loc18_.cachedTimeScale;
  135.                   _loc15_ += _loc18_.cachedStartTime;
  136.                   _loc18_ = _loc18_.timeline;
  137.                }
  138.                _loc17_ = _loc14_ * _loc15_;
  139.                if(_loc17_ <= _loc8_ && (_loc17_ + _loc16_.totalDuration * _loc14_ + 1e-10 > _loc8_ || _loc16_.cachedDuration == 0))
  140.                {
  141.                   _loc9_[_loc19_ = _loc12_++] = _loc16_;
  142.                }
  143.             }
  144.          }
  145.          if(_loc12_ == 0)
  146.          {
  147.             return _loc6_;
  148.          }
  149.          _loc5_ = int(_loc12_);
  150.          if(param4 == 2)
  151.          {
  152.             while(--_loc5_ > -1)
  153.             {
  154.                _loc7_ = _loc9_[_loc5_];
  155.                if(_loc7_.killVars(param2))
  156.                {
  157.                   _loc6_ = true;
  158.                }
  159.                if(_loc7_.cachedPT1 == null && _loc7_.initted)
  160.                {
  161.                   _loc7_.setEnabled(false,false);
  162.                }
  163.             }
  164.          }
  165.          else
  166.          {
  167.             while(--_loc5_ > -1)
  168.             {
  169.                if(TweenLite(_loc9_[_loc5_]).setEnabled(false,false))
  170.                {
  171.                   _loc6_ = true;
  172.                }
  173.             }
  174.          }
  175.          return _loc6_;
  176.       }
  177.    }
  178. }
  179.  
  180.