made segment direction fill-sensitive
[swftools.git] / lib / as3 / ok / while.as
1 package test.package {
2     public class Main extends flash.display.MovieClip {
3         function Main() {
4             var i = 0;
5             var j = 0;
6             while(i*i<100) {
7                 i++;
8             }
9             if(i!=10) trace("error");
10             else trace("ok 1/3");
11             
12             while(j*j<121) {
13                 i++;
14                 j++;
15             }
16             if(i!=21) trace("error");
17             else trace("ok 2/3");
18
19
20             /* notice: this type of overloading behaves differently if
21                this function is switched into compatibility mode */
22             var x1=0;
23             var a=1;
24             var sum=0;
25             while(x1<10) {
26                 var x2=0;
27                 var a=2;
28                 x2 = 0;
29                 while(x2<10) {
30                     var x3=0;
31                     var a=3;
32                     x3 = 0;
33                     while(x3<10) {
34                         var a=4;
35                         sum+=a;
36                         x3++;
37                     }
38                     sum+=a;
39                     x2++;
40                 }
41                 sum+=a;
42                 x1++;
43             }
44             sum+=a;
45             if(sum!=4321) trace("error");
46             else trace("ok 3/3");
47             
48             trace("[exit]");
49         }
50     }
51 }
52