Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   формат в TextField (http://www.flasher.ru/forum/showthread.php?t=70268)

as_68 11.10.2005 13:43

формат в TextField
 
Как совместить два формата в одном TextField?
Т.е. в строке все слова зеленые, а одно красное подчеркнутое.

Mokus 11.10.2005 14:43

используй HTML

7thsky™ 11.10.2005 14:47

так же можно:

у TextField'a есть метод setTextFormat (); один из вариантов использования такой
setTextFormat (startIndex, endIndex, textFormat);

iNils 11.10.2005 15:45

fmt1 = new TextFormat ();
fmt1.color = 0xff0000;
fmt2 = new TextFormat ();
fmt2.color = 0xffffff;
_root.createTextField ("txt", 0, 0, 0, 200, 200);
txt.wordWrap = true;
txt.border = 1;
txt.autoSize = true;
txt.setNewTextFormat (fmt2);
for (var i = 0; i < 200; i++) {
txt.text += i + " ";
}
len = 10;
i = len;
this.onEnterFrame = function () {
i++;
if (i > txt.text.length + len) {
i = len;
}
txt.setTextFormat (i - len * 2, i - len, fmt2);
txt.setNewTextFormat (i - len, i, fmt1);
};

as_68 11.10.2005 18:55

сенкс


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

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