topical media & game development

talk show tell print

animation-ch08-Twips.ax

animation-ch08-Twips.ax [swf] [flash] flex


  package
  {
          import flash.display.Sprite;
          import flash.events.Event;
          
          public class @ax-animation-ch08-Twips extends Sprite
          {
                  public function @ax-animation-ch08-Twips()
                  {
                          init();
                  }
                  
                  private function init():void
                  {
                          var sprite:Sprite;
                          sprite = new Sprite();
                          addChild(sprite);
                          sprite.x = 0;
                          var targ:Number = 100;
                          for(var i:Number=0;i<20;i++)
                          {
                                  trace(i + ": " + sprite.x);
                                  sprite.x += (targ - sprite.x) * .5;
                          }
                  }
          }
  }
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.