Показать сообщение отдельно
Старый 01.09.2011, 21:58
Isaac вне форума Посмотреть профиль Отправить личное сообщение для Isaac Найти все сообщения от Isaac
  № 1  
Ответить с цитированием
Isaac

Регистрация: Aug 2011
Сообщений: 100
По умолчанию Пауза между таймерами

Есть ф-ии
Код AS3:
public function effText():void
		{
			frameTime = Math.round(textSpeed * 1 / this.stage.frameRate);
			charTimer = new Timer(frameTime);
 
			charTimer.addEventListener(TimerEvent.TIMER, charTimerComplete);
			charTimer.start();
 
			charTimerTarget = txt1;
			charTimerTargetSource = 'Bad decisions\ncatching up with you?';
			charTimerTargetData = charTimerTargetSource.split('');
			charTimerTargetCount = 0;
		}
 
		public function charTimerComplete(event:TimerEvent):void
		{
			if (charTimerTargetCount < charTimerTargetData.length)
			{
				charTimerTarget.appendText(charTimerTargetData[charTimerTargetCount]); 
				charTimerTargetCount ++;
			}else
			 {
				 switch(messageCount)
				 {
					 case 0:
					 {
						 txt1.text = '';												 
						 charTimerTargetSource = 'Improve your driving skills\nwith traffic school... Online!';						 
						 charTimerTargetData = charTimerTargetSource.split('');
						 charTimerTargetCount = 0;						 
					 } break;
 
					 case 1:
					 {
						 txt1.text = '';
 
						 charTimerTargetSource = 'Clear your record at\nyour own convenience.';
						 charTimerTargetData = charTimerTargetSource.split('');
						 charTimerTargetCount = 0;						 
					 } break;
 
					 case 2:
					 {
						 txt1.text = '';
						 txt1.y = 15;
						 charTimerTargetSource = "Start your court-approved\ntraffic school\nbefore it's too late!";
						 charTimerTargetData = charTimerTargetSource.split('');
						 charTimerTargetCount = 0;
					 } break;
 
					 case 3:
					 {
						 charTimer.stop();
					 } break;
				 }
 
				 messageCount ++;
			 }			 
		}
Как сделать, чтоб после каждого case, перед выводом нового сообщения и перед charTimerTargetCount = 0;(очисткой строки), была небольшая пауза ?