In this experiment, we continue examining the native 3D support provided by Flash Player 10. If you need help installing the player and the authoring tool, consult our previous Flash Player 10 tutorial: 'Getting Started with 3D Methods in Flash Player 10'
To open the appplet, click on the appropriate link below the picture. If you have Flash Player 10 Beta 1 (relased May 15), click on the first link. If you have Flash Player 10 Beta 2 (released July 2), click on the second link.
- A zip file p10cube.zip
The zip file linked above contains all the 'as' and 'jpg' files related to this experiment.
In this experiment, we tried as much as possible to stick with the simplest native 3D methods available in Player 10: rotationX, rotationY, and the perspectiveProjection object. We 'build' and rotate the cube using those methods. We use the more complicated matrix3D class for depths-sorting only.
We ran into some difficulties accessing and manipulating the perpectiveProjection object. The object does not seem to behave as it should according to the Flash Player 10 documentation. The only DisplayObject whose perpectiveProjection property can be accessed and maniplulated is the root object. We discuss this issue on the next page.
Note: The 'as' file in the zip file corresponding to the applet above is 'CubeMenu.as'. We used flex_sdk_3 (nightly build, May 15) to compile 'CubeMenu.as' into 'CubeMenu.swf' file for Beta 1 Player. We used flex_sdk_126.96.36.1991 (nightly build, July 9) to compile for Beta 2 version. We created the html 'wrapper', 'CubeMenu.html' using Flash CS3. Namely, we created and published an empty movie 'CubeMenu.fla' with the Stage dimensions and the background color corresponding to those specified in 'CubeMenu.as'. Then we deleted the empty 'swf' file and substituted it by the 'swf' compiled by the Flex compiler.
On the next page, we discuss the code behind the applet.