
//-------------------------------
// 例文の表示と消去
//-------------------------------
WIDTH_VALUE = 60;
HEIGHT_VALUE = 50;
COUNT_VALUE = 5;

ex_bg.onEnterFrame = function(){
	var height:Number;
	var width:Number;

	height = ex_bg._height;
	width = ex_bg._width;

	if( _global.explainFlag == 'open' ){

		if( height < HEIGHT_VALUE*COUNT_VALUE ){

			width += WIDTH_VALUE;
			height += HEIGHT_VALUE;

			if( height > HEIGHT_VALUE*COUNT_VALUE ){
				height = HEIGHT_VALUE*COUNT_VALUE;
				width = WIDTH_VALUE*COUNT_VALUE;
				_global.explainFlag = 'idle';

				setDepth( ex_bg );
//				ex_bg.swapDepths( _global.depth++ );
			}
		}
	}else if( _global.explainFlag == 'close' ){

		if( height > 1 ){

			width -= WIDTH_VALUE;
			height -= HEIGHT_VALUE;

			if( height < 1 ){
				height = 1;
				width = 1;
				_global.explainFlag = 'idle';
			}
		} else {
			_global.explainFlag = 'idle';
		}
	}

	ex_bg._height = height;
	ex_bg._width = width;
};


//-------------------------------
// 説明ボタン
//-------------------------------
Ex_bu.onRelease = function() {
	
	if( _global.comStatus == 'idle' ){

		if( _global.explainFlag == 'idle' ){

			if( ex_bg._height == 1 ){

				_global.explainFlag = 'open';
				setDepth( ex_bg );
//				ex_bg.swapDepths( _global.depth++ );

			}else{
		
				_global.explainFlag = 'close';

			}
		}
	}

}


//-------------------------------
//説明文・命令文を外部ファイルから取り出す
//-------------------------------
function getExternalText(){

var my_lv:LoadVars = new LoadVars();

my_lv.onLoad = function(success){
	if( success ){
//		trace( "命令文:" + my_lv.CommandText );
//		trace( "説明文:" + my_lv.ExplainText );
		ex_bg.meirei.text = my_lv.CommandText;
		explain.setsumei.text = my_lv.ExplainText;
	} else {
		trace( "Error" );
	}
	delete my_lv;
}

my_lv.load( "command.txt" );

}

