Search code examples
actionscript-3animationtween

AS3: How to use GTween?


I'm working with the latest version of the SDKs and FlashDevelop. So far, everything about my setup works fine, including external libraries. But when I use GTween, nothing happens. At all. I've tried several of the included samples and some of my own code, and all I get is a blank window or nothing moves, respectively. No errors, but also no action.

Could someone paste in some minimal code that just loads GTween and has it move a sprite? I'd like to have a known good for comparison so I can see if I'm missing something obvious or if there's something weird going on.

Thanks! :)


Solution

  • i just downloaded GTween and copied the com folder to my source...

    ... this worked fine:

    package{
       import com.gskinner.motion.GTween;
    
       import flash.display.Sprite;
    
       public class GtTest extends Sprite{
    
         public function GtTest(){
               var ball:Sprite = new Sprite();
               ball.graphics.beginFill(0xFF0000);
               ball.graphics.drawCircle(300,300,10);
               addChild(ball);
               var myTween:GTween = new GTween(ball, 2, {x:100, y:100}, {swapValues:true});
          }
       }
    }
    

    hope that helps ;)