Move around above and you will see the Snowstorm example using the classes from the Chapter 12 Penner AS2 post.
To replicate this example:
- Create a new Flash movie and then create a MovieClip at (0, 0).
- In this MovieClip, add a rectangle 400px wide by 300px high with the registration point at the top left of the rectangle.
- This will be the boundingBox of the snow component. Give the MovieClip an instance name of “boundingBox”.
- Select this MovieClip on the stage and convert it to another MovieClip. Name this clip “snow” and add the class linkage of “com.robertpenner.profmx.snow.Snow”. Also, give it an instance name of “snow”.
- You will now convert this MovieClip to a component. Right-click on it and select “Component Definition”. In the window that pops up add the same class to the area that says “AS 2.0 Class:”.
- Click on the Parameters tab to see the following component options: fallSpeed, friction, maxFlakes, and zDepth. Play around with these options.
- On the root timeline add the following code and compile: