inner class in AS

jason picture jason · Aug 29, 2010 · Viewed 15k times · Source

for example:

 package{
    public class A {
       var test:String;
       public function A()
       }

}
 class B{

}

the code is in the same file, we call B is inner class, then how to call the constructor of class B

Answer

PatrickS picture PatrickS · Aug 29, 2010
package
{
    public class A 
    {
       var test:String;

       public function A()
       {
          var b:B = new B();
       }
    }
}
class B
{
   public function B()
   {
       trace('class B');
   }
}