Saqoosha

  1. About
  2. Archives
  3. Search
  4. Say
Language:

キミも覚悟を示せ。

Sorry, this entry is only available in Japanese.

スーパー高速に射影変換するには

Sorry, this entry is only available in Japanese.

GE の AR のん作った人に会った

Sorry, this entry is only available in Japanese.

英語でブログを書く

Sorry, this entry is only available in Japanese.

BetweenAS3Thread

package net.saqoosha.thread {
 
    import org.libspark.betweenas3.tweens.ITween;
    import org.libspark.thread.IMonitor;
    import org.libspark.thread.Monitor;
    import org.libspark.thread.Thread;
 
    public class BetweenAS3Thread extends Thread {
 
        private var _tween:ITween;
        private var _monitor:IMonitor;
 
        public function BetweenAS3Thread(target:ITween) {
            _tween = target;
            _monitor = new Monitor();
        }
 
        public function cancel():void {
            interrupt();
        }
 
        override protected function run():void {
            _monitor.wait();
            interrupted(interruptedHandler);
            _tween.onComplete = _monitor.notifyAll;
            _tween.play();
        }
 
        private function interruptedHandler():void {
            if (_tween.isPlaying) {
                _tween.stop();
            }
        }
    }
}

Very simple.