チェンジセット 2469
- コミット日時:
- 2009/04/16 20:26:28 (4 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/BetweenAS3/trunk/src/fp10/org/libspark/betweenas3/tweens/ITween.as
r2285 r2469 60 60 function get isPlaying():Boolean; 61 61 62 /** 63 * このトゥイーンの完了時に再生を停止するのであれば true, そうでなければ false を設定します. 64 */ 65 function get stopOnComplete():Boolean; 66 67 /** 68 * @private 69 */ 70 function set stopOnComplete(value:Boolean):void; 71 62 72 function get onPlay():Function; 63 73 function set onPlay(value:Function):void; as3/BetweenAS3/trunk/src/fp10/org/libspark/betweenas3/tweens/StandardTween.as
r2286 r2469 57 57 private var _startTime:Number; 58 58 private var _isPlaying:Boolean = false; 59 private var _stopOnComplete:Boolean = true; 59 60 private var _dispatcher:IEventDispatcher; 60 61 private var _willTriggerFlags:uint = 0; … … 100 101 } 101 102 103 /** 104 * @inheritDoc 105 */ 106 public function get stopOnComplete():Boolean 107 { 108 return _stopOnComplete; 109 } 110 111 /** 112 * @private 113 */ 114 public function set stopOnComplete(value:Boolean):void 115 { 116 _stopOnComplete = value; 117 } 118 102 119 public function get onPlay():Function 103 120 { … … 262 279 if (t >= _duration) { 263 280 _position = _tweenTarget.duration; 264 _isPlaying = false; 265 if ((_willTriggerFlags & 0x08) != 0) { 266 _dispatcher.dispatchEvent(new BetweenEvent(BetweenEvent.COMPLETE)); 267 } 268 if (_onComplete != null) { 269 _onComplete.apply(null, _onCompleteParams); 270 } 271 return true; 281 if (_stopOnComplete) { 282 _isPlaying = false; 283 if ((_willTriggerFlags & 0x08) != 0) { 284 _dispatcher.dispatchEvent(new BetweenEvent(BetweenEvent.COMPLETE)); 285 } 286 if (_onComplete != null) { 287 _onComplete.apply(null, _onCompleteParams); 288 } 289 return true; 290 } 291 else { 292 if ((_willTriggerFlags & 0x08) != 0) { 293 _dispatcher.dispatchEvent(new BetweenEvent(BetweenEvent.COMPLETE)); 294 } 295 if (_onComplete != null) { 296 _onComplete.apply(null, _onCompleteParams); 297 } 298 _position = t - _duration; 299 _startTime = time - _position; 300 tick(time); 301 } 272 302 } 273 303 as3/BetweenAS3/trunk/tests/fp10/org/libspark/betweenas3/tweens/StandardTweenTest.as
r2286 r2469 180 180 assertEquals(2500, _target.t); 181 181 } 182 183 test function stopOnComplete():void 184 { 185 _tween.stopOnComplete = false; 186 187 _tween.play(); 188 var b1:Boolean = _ticker.listener.tick(2500); 189 var b2:Boolean = _ticker.listener.tick(4500); 190 191 assertFalse(b1); 192 assertFalse(b2); 193 assertTrue(_tween.isPlaying); 194 assertEquals('play update update update complete update ', Static.log); 195 assertEquals(500, _target.t); 196 } 182 197 } 183 198 }

