release 0.5.4
[swfdec.git] / test / trace / textformat-valueof.as
blob18aea1a2c0519547973612ba2ddbeaaeac4fa8ad
1 // makeswf -v 7 -r 1 -o textformat-7.swf textformat.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"
26 var tester_counter = 0;
27 var tester = new Object ();
29 tester.valueOf = function () {
30 tester_counter++;
31 trace ("valueOf: " + tester_counter);
32 return tester_counter;
35 tester.toString = function () {
36 tester_counter++;
37 trace ("toString: " + tester_counter);
38 return "toString_" + tester_counter;
42 var fmt = new TextFormat();
44 for (var i = 0; i < properties.length; i++) {
45 var prop = properties[i];
46 trace ("Testing: " + prop);
47 fmt[prop] = tester;
48 trace (fmt[prop]);
52 var align_tester_counter = 0;
53 var align_tester = new Object ();
55 align_tester.toString = function () {
56 align_tester_counter++;
57 trace ("aling_toString: " + align_tester_counter);
58 if (align_tester_counter % 4 == 0) {
59 return "left";
60 } else if (align_tester_counter % 3 == 0) {
61 return "center";
62 } else if (align_tester_counter % 2 == 0) {
63 return "right";
64 } else {
65 return "justify";
69 trace ("Testing align:");
70 for (var i = 0; i < 5; i++) {
71 fmt["align"] = align_tester;
72 trace (fmt["align"]);
76 var display_tester_counter = 0;
77 var display_tester = new Object ();
79 display_tester.toString = function () {
80 display_tester_counter++;
81 trace ("display_toString: " + display_tester_counter);
82 if (display_tester_counter % 3 == 0) {
83 return "none";
84 } else if (display_tester_counter % 2 == 0) {
85 return "inline";
86 } else {
87 return "block";
91 trace ("Testing display:");
92 for (var i = 0; i < 5; i++) {
93 fmt["display"] = display_tester;
94 trace (fmt["display"]);
98 loadMovie ("FSCommand:quit", "");