package launcher.button 
{
	/**
	 * ...
	 * @author alekskart
	 */
	import launcher.button.*;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import caurina.transitions.Tweener;
	 
	public class FightButton extends MovieClip 
	{
		public var fightbuttonActiveENI:fight_button_active_en = new fight_button_active_en();
        public var fightbuttonActiveRUI:fight_button_active_ru = new fight_button_active_ru();
        public var fightbuttonENI:fight_button_en = new fight_button_en();
        public var fightbuttonHoverENI:fight_button_hover_en = new fight_button_hover_en();
        public var fightbuttonHoverRUI:fight_button_hover_ru = new fight_button_hover_ru();
		public var fightbuttonRUI:fight_button_ru = new fight_button_ru();
		
		public var fightbuttonEN:MovieClip = new MovieClip();
		public var fightbuttonRU:MovieClip = new MovieClip();
		
		public function FightButton() 
		{
			
			//fightbuttonRU.alpha = 0.7; 
            fightbuttonRU.addEventListener(MouseEvent.MOUSE_OVER, onFightButtonOver);
            fightbuttonRU.addEventListener(MouseEvent.MOUSE_OUT, onFightButtonOut);
			fightbuttonRU.addEventListener(MouseEvent.MOUSE_DOWN, onFightButtonDown);
            fightbuttonRU.addEventListener(MouseEvent.MOUSE_UP, onFightButtonUp);
			fightbuttonRU.addChild(fightbuttonRUI);
			fightbuttonRU.buttonMode = true;

			fightbuttonHoverRUI.alpha = 0;
            fightbuttonHoverRUI.visible = true;
            Tweener.addTween(fightbuttonHoverRUI, { alpha: 1, time: 2.5, transition: "linear", delay: 0, onComplete: startHoverAnimation });
			addChild(fightbuttonRU);
			fightbuttonRU.addChild(fightbuttonHoverRUI);
			
		  //  fightbuttonEN.alpha = 0.7; 
            fightbuttonEN.addEventListener(MouseEvent.MOUSE_OVER, onFightENButtonOver);
            fightbuttonEN.addEventListener(MouseEvent.MOUSE_OUT, onFightENButtonOut);
			fightbuttonEN.addEventListener(MouseEvent.MOUSE_DOWN, onFightENButtonDown);
            fightbuttonEN.addEventListener(MouseEvent.MOUSE_UP, onFightENButtonUp);
			fightbuttonEN.addChild(fightbuttonENI);
			fightbuttonEN.buttonMode = true;

			fightbuttonHoverENI.alpha = 0;
            fightbuttonHoverENI.visible = true;
            Tweener.addTween(fightbuttonHoverENI, { alpha: 1, time: 2.5, transition: "linear", delay: 0, onComplete: startHoverENAnimation });
			addChild(fightbuttonEN);
			fightbuttonEN.addChild(fightbuttonHoverENI);
		}
		
        private function startHoverAnimation():void 
		{
            Tweener.addTween(fightbuttonHoverRUI, { alpha: 0, time: 2.5, transition: "linear", delay: 0, onComplete: continueHoverAnimation });
        }

        private function continueHoverAnimation():void 
		{
            Tweener.addTween(fightbuttonHoverRUI, { alpha: 1, time: 2.5, transition: "linear", delay: 0, onComplete: startHoverAnimation });
        }
		
		public function onFightButtonOver(event:MouseEvent):void 
		{
            Tweener.addTween(fightbuttonHoverRUI, { alpha: 0, time: 0 });
            Tweener.addTween(fightbuttonHoverRUI, { alpha: 1, time: 2.5 });
            fightbuttonRU.addChild(fightbuttonHoverRUI);
        }

        public function onFightButtonOut(event:MouseEvent):void 
        {
            Tweener.removeTweens(fightbuttonHoverRUI);
            fightbuttonHoverRUI.alpha = 0;
            Tweener.addTween(fightbuttonHoverRUI, { alpha: 1, time: 2.5, transition: "linear", delay: 0, onComplete: startHoverAnimation });
       }
		
        private function removeHoverTexture():void 
        {
            fightbuttonRU.removeChild(fightbuttonHoverRUI);
            fightbuttonRU.addChild(fightbuttonRUI);
        }

		
		public function onFightButtonDown(event:MouseEvent):void 
		{
            fightbuttonRU.removeChild(fightbuttonRUI);
            fightbuttonRU.addChild(fightbuttonActiveRUI);
        }

		public function onFightButtonUp(event:MouseEvent):void 
		{
            fightbuttonRU.removeChild(fightbuttonActiveRUI);
            fightbuttonRU.addChild(fightbuttonRUI);
	        fightbuttonRU.addChild(fightbuttonHoverRUI);
        }

		
		
		
        private function startHoverENAnimation():void 
		{
            Tweener.addTween(fightbuttonHoverENI, { alpha: 0, time: 2.5, transition: "linear", delay: 0, onComplete: continueHoverENAnimation });
        }

        private function continueHoverENAnimation():void 
		{
            Tweener.addTween(fightbuttonHoverENI, { alpha: 1, time: 2.5, transition: "linear", delay: 0, onComplete: startHoverENAnimation });
        }
		
		public function onFightENButtonOver(event:MouseEvent):void 
		{
            Tweener.addTween(fightbuttonHoverENI, { alpha: 0, time: 0 });
            Tweener.addTween(fightbuttonHoverENI, { alpha: 1, time: 2.5 });
            fightbuttonEN.addChild(fightbuttonHoverENI);
        }

        public function onFightENButtonOut(event:MouseEvent):void 
        {
            Tweener.removeTweens(fightbuttonHoverENI);
            fightbuttonHoverENI.alpha = 0;
            Tweener.addTween(fightbuttonHoverENI, { alpha: 1, time: 2.5, transition: "linear", delay: 0, onComplete: startHoverENAnimation });
       }
		
        private function removeHoverENTexture():void 
        {
            fightbuttonEN.removeChild(fightbuttonHoverENI);
            fightbuttonEN.addChild(fightbuttonENI);
        }

		
		public function onFightENButtonDown(event:MouseEvent):void 
		{
            fightbuttonEN.removeChild(fightbuttonENI);
            fightbuttonEN.addChild(fightbuttonActiveENI);
        }

		public function onFightENButtonUp(event:MouseEvent):void 
		{
            fightbuttonEN.removeChild(fightbuttonActiveENI);
            fightbuttonEN.addChild(fightbuttonENI);
	        fightbuttonEN.addChild(fightbuttonHoverENI);
        }
		
		
        public function updateButton(language:String):void 
		{
            if (language == "RU") 
			{
                fightbuttonEN.visible = false;
				fightbuttonRU.visible = true;
            } 
		    else if (language == "EN") 
		    {
                fightbuttonEN.visible = true;
				fightbuttonRU.visible = false;
            }
        }
		
	}

} раздели этот класс а две части там где только en и там где ru