jasu's blog
블로그 메뉴글
사용한 모든 인터벌 삭제하기
Programming/ActionScript 2.0
2007. 2. 21. 10:57
class IntervalGroup{
private var _intervalAry:Array;
private static var _instance:IntervalGroup;
private function IntervalGroup(){
_intervalAry = new Array();
}
public static function getInstance():IntervalGroup{
if(_instance == null){
_instance = new IntervalGroup();
}
return _instance;
}
public function set interval(num:Number):Void{
_intervalAry.push(num);
}
public function clear():Void{
for(var i=0;i<_intervalAry.length;i++){
clearInterval(_intervalAry[i]);
}
}
}
private var _intervalAry:Array;
private static var _instance:IntervalGroup;
private function IntervalGroup(){
_intervalAry = new Array();
}
public static function getInstance():IntervalGroup{
if(_instance == null){
_instance = new IntervalGroup();
}
return _instance;
}
public function set interval(num:Number):Void{
_intervalAry.push(num);
}
public function clear():Void{
for(var i=0;i<_intervalAry.length;i++){
clearInterval(_intervalAry[i]);
}
}
}