00001 import gugga.events.EventDispatcher;
00002 import gugga.common.ITask;
00003
00007 class gugga.sequence.CustomCompleteTask extends EventDispatcher implements ITask
00008 {
00009 private var mIsRunning : Boolean;
00010
00011 public function start() : Void
00012 {
00013 mIsRunning = true;
00014 dispatchEvent({type: "start", target: this});
00015 }
00016
00017 public function complete() : Void
00018 {
00019 mIsRunning = false;
00020 dispatchEvent({type: "completed", target: this});
00021 }
00022
00023 public function isRunning() : Boolean
00024 {
00025 return mIsRunning;
00026 }
00027
00028 public function isImmediatelyInterruptable() : Boolean
00029 {
00030 return true;
00031 }
00032
00033 public function interrupt() : Void
00034 {
00035 mIsRunning = false;
00036 dispatchEvent({type: "interrupted", target: this});
00037 }
00038 }