Here we've specified two parameters that have values by default: the speed parameter, which stores the pixels each snowflake moves down by every frame, and flakesNumber, which is the number of snowflakes presented on screen. In this case, it's the first code to run when our SWF is started. The constructor is a function that runs when an object is created from a class this code is the first to execute when you make an instance of an object or run using the Document Class. (If you're using Flash CS3, you can use an Array instead of a Vector.) Step 11: Write the Constructor Private var timer:Timer = new Timer(2000) Timer object that controls the horizontal movement A Vector object that will store the snowflakes movieclips Let's take a look at the variables we'll use. Our document class is going to extend the MovieClip class. The subclass inherits all the methods, properties and functions that way we can use them in our class. The extends keyword defines a class that is a subclass of another class. These are the required classes, for a more detailed description about each class, please refer to the Flash Help (press F1 within Flash). If you don't want to group your files in a package or you have only one class you can use it right from your source folder, but the idea here is to be organized. The package keyword allows you to organize your code into groups that can be imported by other scripts it's recommended to name them starting with a lowercase letter and use intercaps for subsequent words - for example: målasses.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |