I was getting some funky errors in my game, and the only think I can figure is something is telling my tweens to autostart. I threw together a quick entity to test
public class TestEntity extends Entity
{
private var _varTween:VarTween;
public function TestEntity()
{
var i:Image = Image.createCircle(20, 0x00FF05);
this.graphic = i;
_varTween = new VarTween(finishedTween);
_varTween.tween(this, "x", 100, 1);
this.addTween(_varTween, false);
}
private function finishedTween():void
{
trace("Tween has finished");
}
}
I have the same problem in this little sample:
- I never call _varTween.start();
- add _varTween with a false in this.addTween()
- All I do is add enity to a world
- Tween always starts and finishedTween() gets called
So what’s happening, do all tweens of an entity get started upon adding an entity to a world?