Move around above and you will see the Aurora Borealis example using the classes from the Chapter 11 Penner AS2 post.
To replicate this example:
- Create a new Flash movie and then create a MovieClip.
- In this MovieClip, add a rectangle 2.5px wide by 100px high with the registration point at the top center of the rectangle.
- Fill the rectangle with a gradient 50% white alpha at the top and 0% white alpha at the bottom. This will be the Aurora Borealis particle.
- Remove this MovieClip from the stage so that it is only in the library and then name it “auroraParticle” and add a class linkage of “com.robertpenner.profmx.auroraBorealis.AuroraParticle” to it.
- Now add another blank MovieClip to the library and name it “auroraBorealis” and add the class linkage of “com.robertpenner.profmx.auroraBorealis.AuroraBorealis” to it.
- 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:”.
- Now drag this component to the stage and place it at the top center.
- Add an instance name of “auroraBorealis” to the component MovieClip and then click on the Parameters tab to see the component options. Play around with these options.
On the root timeline add the following code and compile: