Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 3.0 (http://www.flasher.ru/forum/forumdisplay.php?f=83)
-   -   TextFormat.color и др. (http://www.flasher.ru/forum/showthread.php?t=98115)

Vidar 06.07.2007 13:49

TextFormat.color и др.
 
В справке:
Цитата:

color property

color:Object [read-write]

Language version: ActionScript 3.0
Player version: Flash Player 9.

Indicates the color of the text. A number containing three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green. The default value is null, which means that Flash Player uses the color black (0x000000).
Код:

var tf:TextFormat=new TextFormat();

trace("tf.color is Number "+(tf.color is Number)); // выводит true

trace("typeof(tf.color) "+typeof(tf.color)); // выводит object

tf.color=0x000000;

trace("typeof(tf.color) "+typeof(tf.color)); // выводит number

Баг или так задумано ?

etc 06.07.2007 14:20

Чтобы можно было определить, задана переменная или нет. А именно проверкой на null.

UPD: А ещё color можно задать строкой: color = "0xFFFFFF";


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

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