ru.etcs.effects.TextTween
Версия 1.3.5 14.03.07.
Что нового в версии 1.3.5:
- Исправлена работа removeEventListener. Если в одной области видимости подписано несколько обработчиков, то при удалении удалялся первый добавленный в этой области видимости, а не требуемый.
Что нового в версии 1.3:
- Пофиксены некоторые баги
- Статические свойства-имена событий, предпочтительно их использовать
- Тексты с переводами строк, символами теперь твинятся нормально, без скачков
- Добавлено свойство isPlaying
- Подписка/отписка функций с заданной областью видимости
Использование:
This content requires Adobe Flash Player.
Поиграться можно прям здесь (72 КБ):
Javascript support required
Пожелания, баг-репорты и т.п. приветствуются.
Документация в теле класса.
Класс доступен во фреймворке.
30 comments
30 Comments so far
Leave a reply
У тебя написано: «stop() — остановка твина, событие onTextStop не будет вызвано». А в событиях такого события нет, подразумевается onTextEnd ?
Нет, onTextStop, просто ошибся в описании. Поправил.
почему ты классы не выкладываешь в виде zip? или я не нахожу просто? а то неудобно копи&пастить ))
Мммм, каждый упаковывать муторно.
Хотя, наверное выложу как *.as файлы
Обошёлся без as файлов
Теперь внизу есть ссылка «Загрузить класс» и view plain text source под ftf-ками.
Так как человек я дикий, хотел бы знать…. мона ли этот класс исползывать в АS2 ???
А это и есть AS2 класс, собственно. AS3 версия здесь.
Его нужно положить в папку ru/etcs/effects/ (папки надо создавать рядом с исходником) и назвать TextTween.as
Интересно, а почему duration задается в кадрах? Может быть стоило задавать это параметр в милисекундах? Немного непривычно
Не имеет смысла, это потребует вычисления FPS и т.п. подобных вещей и в конечном итоге будет работать криво.
if you write object oriented code, why don’t you give object oriented usage examples of it?
How would a different class use your TextTween instance?
For example, if my class that extends MovieClip has two TextField instances and i want to tween text in those fields, how should I implement TextTween for those fields to use it?
Oh, just fast method to check it,
For two or more instances of TextField you can use this method (TextTween uses standard EventDispatcher class of Flash 8 ):
import mx.utils.Delegate;import ru.etcs.effects.TextTween;
...any place of code..
var anyTween:TextTween = new TextTween(...)
var anotherTween:TextTween = new TextTween(...)
anyTween.addEventListener('onTextChanged',Delegate.create(this,this.anyTextHandler);
anotherTween.addEventListener('onTextChanged',Delegate.create(this,this.anotherTextHandler);
...
private function anyTextHandler(event:Object):Void {
trace('Text1: ' +event['text']);
}
private function anotherTextHandler(event:Object):Void {
trace('Text2: '+event['text']);
}
...
Hey, thanks very much!
This was a torpedo fast answer ;]
I shall test it as soon as i finish eating my breakfast ;]
Ok, everything works fine ;]
Thanks again!
Very good
It’s brilliant thing!
But I can’t use it
Could you somebody send .fla file with example, please a lot?
My e-mail: yvonia[at]o2.pl
Best regards!
Yvonia
Just create new folder, then create ru/etcs/effects/ folder and copy TextTween.as there.
After that, create text field with instance name “my_txt” on the scene. Select first frame of scene and press F9 to open Actions panel and copy usage example code. That’s all
BTW, i can create example fla, if it difficult to you.
Thanks a lot! It works
Regards!
hush, in new 1.3 version of TextTween you don’t need Delegate. Now, you can use it like this:
import ru.etcs.effects.TextTween;...any place of code..
var anyTween:TextTween = new TextTween(...)
var anotherTween:TextTween = new TextTween(...)
anyTween.addEventListener(TextTween.CHANGED,this.anyTextHandler,this);
anotherTween.addEventListener(TextTween.CHANGED,this.anotherTextHandler,this);
...
private function anyTextHandler(event:Object):Void {
trace('Text1: '+event['text']);
}
private function anotherTextHandler(event:Object):Void {
trace('Text2: '+event['text']);
}
...
Great work!!
But if i want to reverse the text with a button when the text has been shown
[...] класса TextTween на AS3. Код под катом. Собственно, сам класс: This content requires [...]
[...] Собственно — TextTween. [...]
Привет _etcs. Пользую твой TextTween[AS3], не могу сделать Reverse – текстполе заполняется мусорными символами, они и уменьшаются по кол-ву, так и не превращаясь в оригинальный текст.. я что то не правильно понял?
Спасибо.
Так реверс и работает в обратную сторону. Т.е. текст превращается из нормального в мусор, с уменьшением количества символов. А просто твин превращает из мусора в нормальный текст.
хм… у тебя в примере, включая реверс, текст остаётся нормальным у уменьшается…
Зависит ровным счетом от переданных параметров.
Да понял, isReverse = fasle; присваивал отдельно,
Спасибо.
Пожалуй isReverse я зря публичным сделал.
greetings, i have installed this class in my desktop/actionscript folder
yet i get these errors(17 intotal). my txtfield is called my_txt. ia m absolutely sure my classpath is correct.
what is wrong here please? thank you
1046: Type was not found or was not a compile-time constant: Void.
i get this error for 16 other lines , in other words for every function.
what can i do?
You need to set ActionScript 2.0 version in publish settings.
ActionScript 3.0 version of TextTween is here.
my mistake thank you, the russian text here confused me a bit
you can remove my comment if needed.