X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fok%2Fnamespaces1.as;h=2d969dec0e20d6f3056d4510f7c24b388f38b24b;hb=e4687b3aa2aed49fb16ba9e9561344d808750297;hp=96db1f298b3fb5531d5736b4a05c1ca52b6eafda;hpb=5258d9c3123374f700348d3c8596367c85999eea;p=swftools.git diff --git a/lib/as3/ok/namespaces1.as b/lib/as3/ok/namespaces1.as index 96db1f2..2d969de 100644 --- a/lib/as3/ok/namespaces1.as +++ b/lib/as3/ok/namespaces1.as @@ -3,6 +3,8 @@ package my.namespaces { public namespace ns2 = "http://www.swftools.org/"; public namespace ns3 = "http://yet.some.other/namespace"; public namespace ns4 = "bla bla"; + + public namespace ns5 = "bla bla 2"; public class Test { @@ -10,7 +12,7 @@ package my.namespaces { trace("error"); } ns2 static function test() { - trace("ok 2/4"); + trace("ok 2/6"); use namespace my.namespaces.ns2; (new Test()).test2() } @@ -19,12 +21,15 @@ package my.namespaces { } ns1 function test2() {trace("error");} - ns2 function test2() {trace("ok 3/4");} + ns2 function test2() {trace("ok 3/6");} ns3 function test2() {trace("error");} ns4 static function test3() { - trace("ok 4/4"); + trace("ok 4/6"); } + + ns1 function test4() {trace("ok 5/6");} + ns2 function test4() {trace("ok 6/6");} } } @@ -38,10 +43,12 @@ package { public namespace ns4clone = "bla bla"; use namespace ns4clone; - + public class Main extends flash.display.MovieClip { use namespace my.namespaces.ns2; + import my.namespaces.*; + use namespace ns5; private function test1() { my.namespaces.Test.test() @@ -55,11 +62,18 @@ package { } catch(e:Error) { // Proxy is similar to an interface, and will throw some kind // of "class not implemented" exception - trace("ok 1/4"); + trace("ok 1/6"); } my.namespaces.Test.test() - my.namespaces.Test.test3() + + use namespace my.namespaces.ns1; + use namespace my.namespaces.ns2; + var test:Test = new Test(); + test.ns1::test4(); + test.ns2::test4(); + + trace("[exit]"); } } }