OOPs: More Classes

We will copy all of the code that is executed once at the beginning from the bubble movie to the class. We will replace the word "ball" with "this"

The code that is executed once is any code that is not inside a function:

package  {
	public class Bubble extends MovieClip {
       var dx:int=0;
       public var dy:int=-2;
       var origX:int;
	   public function Bubble() {
			// constructor code: anything that happens ONCE at the beginning
		} //constructor
        //other functions
	} //class
} //package

It is a good idea to save after each step because you are moving back and forth between the as file and the code in the original movie.

NEXT: Functions