class LocalData.SoHandler{
	var so:SharedObject;
	var loaded:Boolean = false;
	function SoHandler () {
		this.initLocalData();
	}
	public function loadComplete (mySO:SharedObject) {
		trace("size" + this.so.size);
		mySO.flush();
		this.loaded = true;
	}
	private function initLocalData ():Void {
		SharedObject.addListener('touchWiz', loadComplete);
		this.so = SharedObject.getLocal('touchWiz');
		while (this.so.data.test) {this.so.data.test = true;}
		this.loaded = true;
		trace('Проц пошел...')
		_root.getGadget()
	}
	public function get(index:Object):Object {
		while (this.so.data.test) {}
		return this.so.data[index];
	}
	public function set(index:Object, value:Object):Void {
		this.so.data[index] = value;
		this.so.flush();
	}
	public function getSize () {
		return this.so.getSize();
	}
	public function clear () {
		this.so.clear();   
	}
	public function getContent (str:String):Array {
		var arr:Array = [];
		if (str == "" || str == undefined) {
			for(var i in this.so.data) {
				arr.push(i);
			}
		}else{
			for(var i in this.so.data[str]) {
				arr.push(i);
			}
		}
		return arr;
	}
}