add test for frames and bytes properties of empty movies
[swfdec.git] / test / trace / text-field-get-text-format.as
blobf1397501af2cc7b0ba6822c5d289bbafb57af717
1 // makeswf -v 7 -r 1 -o text-field-get-text-format-7.swf text-field-get-text-format.as
3 var properties = [
4 "align",
5 "blockIndent",
6 "bold",
7 "bullet",
8 "color",
9 "display",
10 "font",
11 "indent",
12 "italic",
13 "kerning",
14 "leading",
15 "leftMargin",
16 "letterSpacing",
17 "rightMargin",
18 "size",
19 "tabStops",
20 "target",
21 "underline",
22 "url"
25 function format_to_string (fmt) {
26 str = "";
27 for (var i = 0; i < properties.length; i++) {
28 str += " " + properties[i] + "=" + fmt[properties[i]];
30 return str;
33 this.createTextField ("t", 1, 0, 0, 200, 200);
35 t.html = true;
36 t.htmlText = "<p align='right'>a<b>b<i>c</i>d<u>e</u>f</b>g</p>\rh<font size='20'>i</font>j\r";
38 // normal
39 trace ("all:" + format_to_string (t.getTextFormat ()));
40 for (var i = 0; i < t.length; i++) {
41 trace (i + ":" + format_to_string (t.getTextFormat (i)));
42 for (var j = i + 1; j < t.length; j++) {
43 trace (i + "-" + j + ":" + format_to_string (t.getTextFormat (i, j)));
47 // special cases
48 trace ("-1:" + format_to_string (t.getTextFormat (-1)));
49 trace ("-1, 5:" + format_to_string (t.getTextFormat (-1, 5)));
50 trace ("-1, 30:" + format_to_string (t.getTextFormat (-1, 30)));
51 trace ("0, -1:" + format_to_string (t.getTextFormat (0, -1)));
52 trace ("5, 30:" + format_to_string (t.getTextFormat (5, 30)));
53 trace ("2, 4, 6:" + format_to_string (t.getTextFormat (2, 4, 6)));
54 trace ("5, 4:" + format_to_string (t.getTextFormat (5, 4)));
55 trace ("5, 5:" + format_to_string (t.getTextFormat (5, 5)));
56 trace ("30, 35:" + format_to_string (t.getTextFormat (30, 35)));
58 loadMovie ("FSCommand:quit", "");