The Gallery

Due to the great popularity of our 3D Spinning Menu and Photo Gallery in Flash CS4, we decided to create an enhanced version and incorporate our reader's suggestions. Among other features, the new version is XML-driven and thus easily customizable, each instance of the SpinnerMenu has its own PerspectiveProjection object thus multiple instances in one movie look much better. We also added captions to loaded images.

Click on the screen shot below to open the applet:

Download

In the package, you will find the xmlspinner.fla, SpinnerMenu.as, ImageLoader.as, and all the image files. Much of the code is commented with instructions for customization. The class SpinnerMenu has undergone changes and improvements even though we didn't change its name.

One of the improvements is a PerspectiveProjection object attached to each instance of SpinnerManu. Creating PerspectiveProjection for individual DisplayObjects is tricky. We will post soon a tutorial devoted to this topic.

The spinning 3D effect is created using the new methods of ActionScript 3 available in Flash Player 10. As you will see from the code, a custom SpinnerMenu AS3 class is at the heart of the applet. We describe public methods and properties of the class on the last page of this tutorial.

For loading thumbnails, we use our ImageLoader class. This part is optional; you can store thumbnails in the Library rather than load them at runtime. You will find the description of the ImageLoader class in one of our earlier tutorials: A 3D Menu on a Cube with Perspective, Custom Bitmap Tramsformations in AS3.

Properties of each of the two instances of the SpinnerMenu on the Stage are determined by their corresponding XML files. On the next page, we discuss menu1.xml and show how to change the file for easy customization.

Images in the gallery courtesy of NASA: NASA multimedia collection.

Back to Flash CS4 Tutorials              Back to Flash and Math Home

We welcome your comments, suggestions, and contributions. Click the Contact Us link below and email one of us.

Adobe®, Flash®, ActionScript®, Flex® are registered trademarks of Adobe Systems Incorporated.