OOPs: More Classes

We will copy all of the variable declarations from the bubble movie to the class. We will replace the word "ball" with "this"

We may want to make some instances of the Bubble class rise faster or slower, so we will make dy public:

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: Constructor