package  classes.gustavo.midia.player
{
	import flash.display.*;
	import flash.text.*;
	import flash.utils.setTimeout;
	
	import classes.greensock.*
	import classes.greensock.easing.*
	
	public class NomeMusic extends Sprite
	{
		
		private var texto			:TextField;
		private var mascara			:MovieClip;
		
		
		public function NomeMusic() 
		{
			
			texto 			= _texto_txt;
			mascara			= _mascara_mc;
			
			addPropText();
			
		}
		
		private function addPropText():void
		{
			
			texto.selectable 		= 		false;
			texto.autoSize			=		TextFieldAutoSize.LEFT;
			texto.x					=       mascara.width;
			texto.cacheAsBitmap		=       true;
			
		}
		
		public function set setText(_texto:String):void
		{

			texto.text = _texto;
			
	
		}
		
		public function init():void
		{
		
			TweenLite.to(texto,10, { x:(texto.x + texto.width) * -1,overwrite:true,ease:Linear.easeIn, onComplete:function() {
			
					close();
					init();
				
			}});
			

			
			
			return void;
		}
		
		public function stopText():void
		{
			
			TweenLite.to(texto,2, { x:-2,overwrite:true, ease:Linear.easeInOut } );
			
					
				
			return void;
		}
		
		public function playText():void
		{
			
			init();
			
					
				
			return void;
		}
		
		public function reset():void
		{
			texto.text = "";
			close();
			
			return void;
		}
		
		private function close():void
		{
			
			texto.x = mascara.width;	
			
			return void;
		}
		
		
		
	}//end class

}