gfxpoly: added additional save method
[swftools.git] / lib / as3 / ok / for-in.as
1 package {
2     import flash.display.MovieClip
3     public class Main extends flash.display.MovieClip {
4
5         var ci:int = 0;
6
7         function Main() {
8             var a:Array = new Array(1,2,3,4,6,5,7,8,9,10);
9             var j:int = 0;
10             for(var x in a) {
11                 j += x;
12             }
13             if(j==45) trace("ok 1/6");
14            
15             var y;
16             j = 0;
17             for(y in a) {
18                 j += y;
19             }
20             if(j==45) trace("ok 2/6");
21             
22             j = 0;
23             for each(var x in a) {
24                 j += x;
25             }
26             if(j==55) trace("ok 3/6");
27             
28             var z = 0;
29             j = 0;
30             for each(z in a) {
31                 j += z;
32             }
33             if(j==55) trace("ok 4/6");
34             
35             var i:int = 0;
36             j = 0;
37             for each(i in a) {
38                 j += i;
39                 if(i==6)
40                     break;
41                 else
42                     continue;
43             }
44             if(j==16) trace("ok 5/6");
45
46             j = 0;
47             for each(ci in a) {
48                 j += ci;
49             }
50             if(j == 55) trace("ok 6/6");
51
52             trace("[exit]");
53         }
54     }
55 }
56