Add method to class : Member method : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Member method »

 

Add method to class


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

      var cla:MyClass = new MyClass("S");
      
      cla.aMethod(  );
    }
  }
}
internal class MyClass {
    internal var varName;
    private var currentVar = 1000;

    public function MyClass (name) {
      this.varName = name;
    }

    function aMethod (  ) {
      trace(" in aMethod");
    }
  }

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Class
» Member method