package classes { public class A { public function A() { var b:B = new B(); } } } class B { public function B() { trace("Hello"); } }
Class B is only visible to class A - you cannot have more than one visible class in one file (exactly what the error message states).
And you cannot have more than one package in a file.
一个as文件中只能一个package,而且只能有一个对外可见的as类,文件内不可见的类只能在可见的类内使用
http://stackoverflow.com/questions/5888494/flex-4-two-classes-in-one-file