gfxpoly: added additional save method
[swftools.git] / lib / as3 / ok / break.as
1 package test.package {
2     public class Main extends flash.display.MovieClip {
3         function Main() {
4             var i:int;
5             /* test breaking loop */
6             for(i=0;i<100;i++) {
7                 var x=-1;
8                 if(i*i==49)
9                     break;
10             }
11             if(i!=7) trace("error");
12             else trace("ok 1/4");
13            
14             /* test not breaking loop */
15             for(;i<10;i++) {
16                 var x="String";
17                 if(i==20)
18                     break;
19             }
20             if(i!=10) trace("error");
21             else trace("ok 2/4");
22            
23             /* test breaking while */
24             while(i<20) {
25                 var x=1.0;
26                 if(i==15)
27                     break;
28                 i++;
29             }
30             if(i!=15) trace("error");
31             else trace("ok 3/4");
32             
33             /* test non-breaking while */
34             while(i<30) {
35                 var x=new Object;
36                 if(i==40)
37                     break;
38                 i++;
39             }
40             if(i!=30) trace("error");
41             else trace("ok 4/4");
42             
43             trace("[exit]");
44         }
45     }
46 }
47