applied hide_doc.patch from Ricardo Pedroso
[swftools.git] / lib / as3 / ok / arguments.as
1 package {
2     import flash.display.MovieClip
3     
4     public class Main extends flash.display.MovieClip {
5         
6         public function f(x,y) {
7             var z = arguments;
8             trace(z[0]);
9             trace(z[1]);
10         }
11
12         function test_function()
13         {
14             f("ok 1/8","ok 2/8");
15         }
16         function test_innerfunction()
17         {
18             var z = function(x,y) {
19                 var z = arguments;
20                 trace(z[0]);
21                 trace(z[1]);
22             }
23             z("ok 3/8", "ok 4/8");
24         }
25         function test_innerslotfunction()
26         {
27             var i = 0;
28             var z = function(x,y) {
29                 var v = arguments;
30                 trace(v[0]);
31                 trace(v[1]);
32                 i++;
33             }
34             z("ok 5/8", "ok 6/8");
35             if(i!=1) 
36                 trace("error");
37         }
38         function test_slottedfunction(r1:String, r2:String)
39         {
40             var z = arguments;
41             if(!(z instanceof Array))
42                 trace("error");
43             if(!(r1 instanceof String))
44                 trace("error");
45             if(!(r2 instanceof String))
46                 trace("error");
47             function inner() {
48                 trace(z[0]);
49                 trace(z[1]);
50             }
51             inner();
52         }
53
54         function Main() {
55             test_function();
56             test_innerfunction();
57             test_innerslotfunction();
58             test_slottedfunction("ok 7/8", "ok 8/8");
59             trace("[exit]");
60         }
61     }
62 }