PDA

Просмотр полной версии : TextFormat.color и др.


Vidar
06.07.2007, 13:49
В справке:
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";