Tween24のloopでのバグ?

by sakusan393
loopPlayクリック
↓
■が回転中にstopクリック
↓
loopPlayをクリック
↓
わけわかめ

ちなみに解決策はtweenインスタンスを作り直すとのことでした。
loopPlayクリック
↓
stopクリック
↓
iniTweenクリック
↓
playクリック
↓
OK
♥0 | Line 50 | Modified 2012-11-09 13:07:52 | MIT License
play

ActionScript3 source code

/**
 * Copyright sakusan393 ( http://wonderfl.net/user/sakusan393 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/3NUi
 */

package  
{
    import a24.tween.Tween24;
    import com.bit101.components.PushButton;
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    /**
     * ...
     * @author 
     */
    public class Tween24LoopTest extends Sprite
    {
        private var _loopTween:Tween24;
        private var _box:Sprite;
        
        public function Tween24LoopTest() 
        {
            var container:Sprite = new Sprite();
            addChild(container);
            container.x = container.y = 100;
            
            _box =  new Sprite();
            container.addChild(_box);
            _box.graphics.beginFill(0xFF0000);
            _box.graphics.drawRect(-50, -50, 100, 100);
            
            _loopTween = Tween24.loop(0,
            Tween24.serial(
                Tween24.tween(_box, 1, Tween24.ease.Linear).xy(100,100)
                ,Tween24.tween(_box, 1, Tween24.ease.Linear).rotation(360)
                ,Tween24.tween(_box, 1, Tween24.ease.Linear).xy(0,0)
                ,Tween24.tween(_box, 1, Tween24.ease.Linear).rotation(360)
            ));
            
            new PushButton(this, 10, 10, "loopPlay", playClickHandler);
            new PushButton(this, 120, 10, "stop", stopClickHandler);
            new PushButton(this, 230, 10, "initTween", initClickHandler);
        }
        
        private function initClickHandler(e:MouseEvent):void 
        {
            _loopTween = Tween24.loop(0,
            Tween24.serial(
                Tween24.tween(_box, 1, Tween24.ease.Linear).xy(100,100)
                ,Tween24.tween(_box, 1, Tween24.ease.Linear).rotation(360)
                ,Tween24.tween(_box, 1, Tween24.ease.Linear).xy(0,0)
                ,Tween24.tween(_box, 1, Tween24.ease.Linear).rotation(360)
            ));
        }
        
        private function stopClickHandler(e:MouseEvent):void 
        {
            _loopTween.stop();
        }
        
        private function playClickHandler(e:MouseEvent):void 
        {
            _loopTween.play();
        }
        
    }

}