Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

start() > stop() > start() on a tween resets duration after stop #4

Open
ghost opened this issue Apr 2, 2013 · 2 comments
Open

start() > stop() > start() on a tween resets duration after stop #4

ghost opened this issue Apr 2, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 2, 2013

I've written a test:

public class desuadeTest extends Sprite
{
    private var _testTween:BasicTween;
    public function desuadeTest()
    {
        var target:Sprite = new Sprite();
        var shape:Shape = new Shape();
        shape.graphics.beginFill(0x000000);
        shape.graphics.drawCircle(0,0,10);
        shape.graphics.endFill();
        target.addChild( shape );
        addChild( target );

        target.x = 30;
        target.y = stage.stageHeight / 2;

        _testTween = new BasicTween(target,{ property:"x", value:stage.stageWidth - 30, duration:2 });
        _testTween.start();

        setTimeout( function():void{
            _testTween.stop();
        }, 1000);

        setTimeout( function():void{
            _testTween.start();
        }, 2000);

    }
}

expected behavior:

  • tween takes 3 seconds to complete, 1 second for first half of tween, 1 second for pause, and 1 second to finish

observed behavior:

  • tween takes 4 seconds to complete, 1 second for first half of tween, 1 second for pause, and 2 seconds to finish
@andrewfitz
Copy link
Owner

I believe resume functionality is implemented only in Tween, not BasicTween due to its additional complexity. Replacing it with a regular Tween should work. The layering of complexity was implemented for file size constraints for customers and to insure Partigen would run the most efficiently and not include features that weren't used.

@andrewfitz
Copy link
Owner

Generally speaking, Tweens have the most functionality and should be used unless saving a few k is critical. It was also important to have this configuration because of hundreds of particles (with partigen, which this was engineered for) with 4 tweens on each... well it needed to be memory efficient. Everyday usage of the DMP should use the high level classes such as Tween, MultiTween, ColorTween, BasicPhysics, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant