Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 3.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему  
Старый 29.08.2011, 16:56
Isaac вне форума Посмотреть профиль Отправить личное сообщение для Isaac Найти все сообщения от Isaac
  № 1  
Ответить с цитированием
Isaac

Регистрация: Aug 2011
Сообщений: 100
По умолчанию Работа с FlashEff2, применение эффекта к нескольким текстовым полям

Кто работал с этой библиотекой подскажите пожалуйста
Есть, код. который делает эффект для текста.
Если я хочу добавить 2 или болеетекстовых полей, к которым поочередно нужно применять этот эффект, как мне сделать?
Пишу цикл, но что-то не работает, все время выхывается только первая строчка
Код AS3:
package
{
 
	import com.jumpeye.Events.FLASHEFFEvents;
	import com.jumpeye.flashEff2.text.emerge.FETEmerge;	
 
	import flash.text.TextFormat;
	import flash.text.TextField;
	import flash.display.MovieClip;
 
	public class EffectText extends MovieClip
	{
		private var count:Number = 0;					
 
		public function EffectText()
		{
			var txtArray:Array = new Array();
 
			var txtFrt:TextFormat = new TextFormat();
				txtFrt.font = "Arial";
				txtFrt.color = 0xFFFFFF;
				txtFrt.size = 17;					
				txtFrt.letterSpacing = 1;
 
			var txtFld1:TextField = new TextField();
				txtFld1.type = "dynamic";
				txtFld1.width = 300;
				txtFld1.text = "Bad dicisions\ncatching up with you?";
				txtFld1.x = 160;
				txtFld1.y = 27;
				txtFld1.alpha = 0;
				txtFld1.setTextFormat(txtFrt);
				txtArray.push(txtFld1);
				addChild(txtFld1);
 
			var txtFld2:TextField = new TextField();
				txtFld2.type = "dynamic";
				txtFld2.width = 300;
				txtFld2.text = "Improve your driving skills\nwith traffic school... Online!";
				txtFld2.x = 160;
				txtFld2.y = 27;
				txtFld2.setTextFormat(txtFrt);
				txtFld2.alpha = 0;
				txtArray.push(txtFld2);
				addChild(txtFld2);
 
 
			// Create the FlashEff2Code instance and add it to the stage. The FlashEff2Code
			// component must be in the display list in order for it to work.
			var effect:FlashEff2Code = new FlashEff2Code();
			effect.addEventListener(FLASHEFFEvents.TRANSITION_END, replay);
			addChild(effect);			
 
			// Create the show pattern instance (FESBrightSquares) and set it
			// so the effect looks as you like.
			var showEffect:FETEmerge = new FETEmerge();
			showEffect.preset = 1;
			showEffect.groupDuration = 1.5;
			showEffect.tweenDuration = 1.5;
 
			// Create the hide pattern instance (FESEqualizer) and set it
			// so the effect looks as you like.
			var hideEffect:FETEmerge = new FETEmerge();
			hideEffect.preset = 1; // char: random
			hideEffect.groupDuration = 1.5;
			hideEffect.tweenDuration = 3;
 
			// Assign the show and hide transitions to the FlashEff2Code instance.
			effect.showTransition = showEffect;
			effect.hideTransition = hideEffect;			
 
			// There will be a 3 seconds pause between the show and hide transitions.
			effect.showDelay = 3;
			effect.hideDelay = 1;
 
			// Set the target text field to the FlashEff2Code instance. Once you do this,
			// the show effect will start immediately (except the case when the
			// show effect has a delay too).
			//effect.target = txtFld1;
			effect.target = txtArray[count];	
 
 
 
 
			// When the "hide" transition ends, start the show effect again.
			function replay(evt:FLASHEFFEvents):void
			{
				if (effect.currentTransitionType == "hide")
				{					
					 effect.show();					
				}
 
			}
 
 
		}
	}	
}
Что не так, подскажите пожалуйста?


Последний раз редактировалось Isaac; 29.08.2011 в 17:06.
Создать новую тему   Часовой пояс GMT +4, время: 23:58.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Теги
FlashEff2

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 23:58.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.