add test for frames and bytes properties of empty movies
[swfdec.git] / test / trace / text-field-set-text-format.as
blob076c10cda0dc0a89cd83c493d1b78da741f0bf86
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 function check () {
34 for (var i = 0; i < t.length; i++) {
35 trace (i + ":" + format_to_string (t.getTextFormat (i)));
40 this.createTextField ("t", 1, 0, 0, 200, 200);
42 t.html = true;
43 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";
45 var fmt = new TextFormat ();
47 trace ("Starting state:");
48 check ();
50 trace ("all, font:");
51 fmt.font = "A";
52 trace (t.setTextFormat (fmt));
53 check ();
55 trace ("1, bullet:");
56 fmt.bullet = true;
57 trace (t.setTextFormat (1, fmt));
58 check ();
60 trace ("-3, bullet:");
61 fmt.bullet = true;
62 trace (t.setTextFormat (-3, fmt));
63 check ();
65 trace ("32, bullet:");
66 fmt.bullet = true;
67 trace (t.setTextFormat (32, fmt));
68 check ();
70 trace ("3, 6, bullet:");
71 fmt.bullet = true;
72 trace (t.setTextFormat (3, 6, fmt));
73 check ();
75 trace ("4, 5, !bullet:");
76 fmt.bullet = false;
77 trace (t.setTextFormat (4, 5, fmt));
78 check ();
80 trace ("-1, 2, bullet:");
81 fmt.bullet = true;
82 trace (t.setTextFormat (-1, 2, fmt));
83 check ();
85 trace ("7, 30, bullet:");
86 fmt.bullet = true;
87 trace (t.setTextFormat (7, 30, fmt));
88 check ();
90 trace ("20, 30, !bullet:");
91 fmt.bullet = false;
92 trace (t.setTextFormat (20, 30, fmt));
93 check ();
95 loadMovie ("FSCommand:quit", "");