I've been learning java oop and now I feel confident enough to switch a game that i made in java into actionscript. What is the overall syntax for setting up packages constructors methods and private instance variables. In java a class, constructor and methos would look like this:
public class myClass(){
double myDouble; //private instance var
public myClass(double myDouble){ // constructor
this.myDouble= myDouble;
}
public double getMyDouble(){ // method
return myDouble;
}
public void changeMyDouble(double myDouble){ //method
this.myDouble=myDouble;
}
}
and then to create an object in the main class it would be
myClass myObject =new myClass();
then I could call the methods by
myObject.changeMyDouble(.1);
myObject.getMyDouble
can anyone show me how to port these over line by line.
Also is a package just a group of classes?
I probably messed somthing up so dont tell me I made a syntax error.