Monday, January 24, 2011

AS3 – internal class, public method

AS3 – internal class, public method: "

Juten Tach,

a little quiz again. We have three classes:

The first one is the main class of our swf, InternalTest:

package {
 
   import flash.display.Sprite;
   import testPackage.PublicClass;
 
   public class InternalTest extends Sprite {
      public function InternalTest() {
 
         var publicClass:PublicClass = new PublicClass();
         var ref:Object = publicClass.returnInternalClassRef();
         ref.doSomething();
         ref.doSomethingInternally();
      }
   }
}

Ok, in a package “testPackage” we have two other classes, PublicClass and InternalClass [...]

No comments:

Post a Comment