Flash Player 10 – 3D Example

by

I’ve tinkered a bit with Flash Player 10. One thing that seems almost funny about the 3D effects of Flash thus far is that very few examples show off actually 3D objects. Most examples I’ve examined show 2D planes transformed in 3D space. So, I’ve created a sample 3D cube primitive in AS3 as a convenient example for people who want to get started with their own parsers or drawing tools (etc).

My current configuration is Mac OS X 5.2 + TextMate 1.5.7 + Flex SDK 4.0.0.3504. I have two shell scripts in place:

  1. /usr/bin/mxmlc
  2. A TextMate run bundle set to a hotkey, “command + R”
  3. I’ve also have my Flex SDK set to the absolute path of: /Developer/SDKs/Flex/4.0.0.3504

This configuration requires a flex-config.xml in the same directory as the AS3 class file that you’re compiling. When you run the TextMate script (or something similar in your Terminal shell) it will compile the filename you pass in and default to using a config.xml which acts as a local flex-config.xml file. All of these can be customized as needed.

Example Flash 10 3D cube rotation:
[kml_flashembed movie="http://www.calebjohnston.com/storage/fl10_examples/01_cube_rotation/CubeRotationExample.swf" height="260" width="410" bgcolor="#FFFFFF" /]

Obviously, the above swf won’t work without Flash player 10 installed.

Download the source here.

Tagged ,