Java vs AS3

java


package abc ;

public class C1 extends c2 {
    private int v1;
    public c1() {
        this.v1 = 5;
    }

    int method(int 1) {
        return v1;
    }
}

Actionscript 3.0


package abc{
    public class c1 extends c2 {

        private var v1:int;
        public function c1() {
            this.v1 = 5;
        }
        function method(v1:int):int {
            return v1;
        }
    }
}

In a java application, the main class has to have a main method,
public static void main(String{} args) to start the program.


public class Test {
    public static void main(String[] args) {
        //starting point
    }
}

In a Actionscript 3.0 application, the main class starts the program from its non-arg consructor.

Moreover, the class must inherit MovieClip or Sprite from the flash.display package, otherwise, compile error will occur


package {
    import flash.display.*;
    public class Example extends MovieClip {
        public function Example() {
            //the starting point of the program
        }
        public function Example(args:int) {
        }
    }
}

By | 2013-08-20T20:06:05+00:00 August 20th, 2013|Actionscript 3.0|0 Comments

About the Author:

Leave A Comment