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

  1. package com.greensock.plugins
  2. {
  3.    import com.greensock.TweenLite;
  4.    import flash.display.MovieClip;
  5.    
  6.    public class FramePlugin extends TweenPlugin
  7.    {
  8.       public static const API:Number = 1;
  9.       
  10.       protected var _target:MovieClip;
  11.       
  12.       public var frame:int;
  13.       
  14.       public function FramePlugin()
  15.       {
  16.          super();
  17.          this.propName = "frame";
  18.          this.overwriteProps = ["frame","frameLabel"];
  19.          this.round = true;
  20.       }
  21.       
  22.       override public function onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
  23.       {
  24.          if(!(param1 is MovieClip) || isNaN(param2))
  25.          {
  26.             return false;
  27.          }
  28.          _target = param1 as MovieClip;
  29.          this.frame = _target.currentFrame;
  30.          addTween(this,"frame",this.frame,param2,"frame");
  31.          return true;
  32.       }
  33.       
  34.       override public function set changeFactor(param1:Number) : void
  35.       {
  36.          updateTweens(param1);
  37.          _target.gotoAndStop(this.frame);
  38.       }
  39.    }
  40. }
  41.  
  42.