 			this.removeEventListener(event.type, this.initialize);
 			this.stage.scaleMode = StageScaleMode.NO_SCALE;
 			this.stage.align = StageAlign.TOP_LEFT;
-			Miracle.start(this.stage, this.createHandler, true);
+			_startBtn = new PushButton(this, this.stage.stageWidth >> 1, this.stage.stageHeight >> 1,
+					"Start", this.startBtnHandler );
 		}
 
-		private function choseAnimation():void {
-			//find animation asset and add all of animations to chose list
-			var n:int = _assets.length;
-			for(var i:int = 0; i < n; i++){
-				var asset:Asset = _assets[i];
-				if(asset.type == Asset.TIMELINE_TYPE){
-					//parse output
-					_window = new Window(this, 0, 0, "Chose animation");
-					var list:List = new List(_window, 0, 0, this.getAnimations(asset.output));
-					_window.x = this.stage.stageWidth - _window.width;
-					_window.setSize(_window.height, list.height + 20);
-					list.addEventListener(Event.SELECT, this.selectAnimationHandler);
-				}
-			}
-			var w2:Window = new Window(this, _window.x, _window.y + _window.height + 10, "FPS");
-			list = new List(w2, 0, 0, [1, 5, 16, 24, 30, 35, 40, 60]);
-			w2.height = 120;
-			list.addEventListener(Event.SELECT, this.selectFpsHandler);
+		function clear():void
+		{
+			if(_animation != null) _animation.clear();
+			if(_texture != null) _texture.clear();
+			_texture = null;
+			_animation = null;
+			_fileName = null;
 		}
 
-		[Inline]
-		private function getAnimations(bytes:ByteArray):Array {
-			var result:Array = [];
-			var reader:MafReader = new MafReader();
-			reader.execute(bytes, 1);
-			var animations:Vector.<AnimationHelper> = reader.animations;
-			for each(var animation:AnimationHelper in animations){
-				result.push(animation.name);
-			}
-			return result;
-		}
-		//} endregion PRIVATE\PROTECTED METHODS ========================================
-
-		//==============================================================================
-		//{region							EVENTS HANDLERS
-		private function createHandler(animation:Boolean = false):void {
-			//\TODO: Show view if it exit
-			if(animation || _model.viewerInput == null){
-				_model.viewerInput = _model.lastFileDirection;
-				_model.viewerInput.addEventListener(Event.SELECT, this.selectFileHandler);
-				_model.viewerInput.browseForOpen("Open " + animation ? "Animation" : "Sprite"
-						+ "file that you want to view");
-			}
+		private function startHandler():void {
+			trace("Miracle was started");
+			var maf:Asset = new Asset(_fileName + ".maf", _animation);
+			var mtf:Asset = new Asset(_fileName + ".mtf", _texture);
+			Miracle.createScene(new <Asset>[maf, mtf], this.createdHandler, 1);
 		}
 
-		private function selectFileHandler(event:Event):void {
-			_model.viewerInput.removeEventListener(event.type, this.selectFileHandler);
-			_model.lastFileDirection = _model.viewerInput.parent;
-			var byteArray:ByteArray = new ByteArray();
-			var stream:FileStream = new FileStream();
-			stream.open(_model.viewerInput, FileMode.READ);
-			stream.readBytes(byteArray);
-			stream.close();
-			//parse
-			if(_assets == null)_assets = new <Asset>[];
-			var asset:Asset = new Asset(_model.viewerInput.name, byteArray);
-			if(asset.type == Asset.TIMELINE_TYPE){
-				_name = asset.name;
+		private function createdHandler():void {
+			trace("Scene created");
+			this.getAnimationList();
+		}
+
+		private function getAnimationList():void {
+			var mafReader = new MafReader();
+			mafReader.execute(_animation, 1);
+			var animationsName:Array = [];
+			for each(var animation:AnimationHelper in mafReader.animations)
+			{
+				animationsName.push(animation.name);
 			}
-			_assets.push(asset);
-			if(_assets.length > 1){
-				this.choseAnimation();
-				Miracle.createScene(_assets,null, 1);
-				Miracle.resume();
-			}else{
-				this.createHandler(true);
+			trace("Was get animations", animationsName);
+			_list = new List(this, this.stage.stageWidth - 200, 0, animationsName);
+			_list.width = 200;
+			_list.addEventListener(Event.SELECT, this.selectAnimationHandler);
+		}
+
+		private function getAnimation():void {
+			var file:File = _model.lastFileDirection;
+			file.browseForOpen("Get animation file", [new FileFilter("Miracle animation format", "*.maf")] );
+			file.addEventListener(Event.SELECT, this.animationSelected);
+			file.addEventListener(Event.CANCEL, this.animationSelected);
+		}
+
+		private function readAnimation(file:File):void {
+			_animation = new ByteArray();
+			var fileStream:FileStream = new FileStream();
+			fileStream.open(file, FileMode.READ);
+			fileStream.readBytes(_animation);
+			fileStream.close();
+		}
+
+		private function getTexture(file:File):void {
+			_fileName = file.name.substr(0, -file.extension.length - 1);
+			file.browseForOpen("Get texture file", [new FileFilter("Miracle texture format", _fileName + ".mtf")] );
+			file.addEventListener(Event.SELECT, this.animationSelected);
+			file.addEventListener(Event.CANCEL, this.animationSelected);
+		}
+
+		private function readTexture(file:File):void {
+			_texture = new ByteArray();
+			var fileStream:FileStream = new FileStream();
+			fileStream.open(file, FileMode.READ);
+			fileStream.readBytes(_texture);
+			fileStream.close();
+		}
+
+		public function startBtnHandler(event:Event):void{
+			_startBtn.visible = false;
+			getAnimation();
+		}
+
+		private function animationSelected(event:Event):void {
+			if(event.type == Event.CANCEL)
+			{
+				this.clear();
+				_startBtn.visible = true;
+			}else
+			{
+				if(_animation == null)
+				{
+					this.readAnimation(event.target as File);
+					this.getTexture(event.target as File);
+				}else
+				{
+					this.readTexture(event.target as File);
+					trace("All loaded");
+					Miracle.start(this.stage, this.startHandler, true);
+				}
 			}
 		}
 
 		private function selectAnimationHandler(event:Event):void {
-			var list:List = event.target as List;
-			//add animation to miracle
-			var animation:String = list.selectedItem.toString();
-			log(this, "selectAnimationHandler", animation);
-			var mesh:String = animation.substr(0, animation.lastIndexOf("."));
-			animation = animation.substr(animation.lastIndexOf(".") + 1);
-			if(_current == null){
-				_current = Miracle.scene.createAnimation(mesh, animation, 60);
-				_current.moveTO(this.stage.stageWidth >> 1, this.stage.stageHeight >> 1);
-				_current.addEventListener(Event.ADDED_TO_STAGE, this.imageAddedToStage);
-			}else{
-				_current.mesh = mesh;
-				_current.animation = animation;
-				_current.play();
+			if(_instance != null)
+			{
+				Miracle.scene.removeInstance(_instance);
 			}
-		}
-
-		private function imageAddedToStage(event:Event):void {
-			trace("Added to stage");
-		}
-
-		private function selectFpsHandler(event:Event):void {
-			var list:List = event.target as List;
-			//add animation to miracle
-			if(_current != null){
-				_current.fps = int(list.selectedItem);
-			}
+			var selected:String = _list.selectedItem as String;
+			var dot:int = selected.lastIndexOf(".");
+			var animation:String = selected.substr(dot+1);
+			var mesh:String = selected.substr(0, dot);
+			_instance = Miracle.scene.createAnimation(mesh, animation, 30);
+			_instance.x = this.stage.stageWidth >> 1;
+			_instance.y = this.stage.stageHeight >> 1;
+			_instance.visible = true;
 		}
 		//} endregion EVENTS HANDLERS ==================================================
 

	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.filesystem.FileMode;
	import flash.filesystem.FileStream;
	import flash.utils.ByteArray;
	import flash.utils.setTimeout;

	[SWF(backgroundColor="0x333333", frameRate=60)]
	public class ViewerView extends Sprite {

		private var _model:AppModel;
		private var _assets:Vector.<Asset>;
		private var _window:Window;
		private var _name:String;
		private var _current:MiracleAnimation;

		public function ViewerView(model:AppModel = null) {
			super();

 */
package com.merlinds.miracle_tool.viewer {
	import com.bit101.components.List;
	import com.bit101.components.PushButton;
	import com.merlinds.miracle.Miracle;
	import com.merlinds.miracle.animations.AnimationHelper;
	import com.merlinds.miracle.display.MiracleDisplayObject;
	import com.merlinds.miracle.utils.Asset;
	import com.merlinds.miracle.utils.MafReader;
	import com.merlinds.miracle_tool.models.AppModel;
