download the perspective cube zip file. The zip contains both Flash 5 version and Flash MX version.
You can easily find tutorial about 3d "wire-framed" cube. Just setup 8 points in 3d space. Then apply the 3d equation to calculate the x,y of 2D, then connect them with lines.
Now how to make "face" instead of frames ?
In Flash MX, we can use the draw api to draw a filled face. In Flash 5, it is more complex. I use 3 skewed triangle to fill a face. So, I need 12 triangles.
Lets talk about the MX draw api first.
The first step is setting up the 8 points in 3d space.
The second step is setting up the 6 faces. Store the corners point to the face.
clipArray.reg = [p0, p1, p2, p3];
clipArray.reg = [p4, p5, p6, p7];
clipArray.reg = [p0, p1, p5, p4];
// face 1
clipArray.reg = [p1, p2, p6, p5];
// face 2
clipArray.reg = [p2, p6, p7, p3];
// face 3
clipArray.reg = [p3, p7, p4, p0];
Then in each face movieClip, I createEmptyMovieClip, and make it draw a filled quadrangle connecting the corners.
pt1 = f3dPoint(clip.reg);
pt2 = f3dPoint(clip.reg);
pt3 = f3dPoint(clip.reg);
pt4 = f3dPoint(clip.reg);
Of course, I need 3D functions and rotation functions. They are described in other sessions.
Well, in Flash 5, the clipArray will contain 12 clip elements. Each clip element is a triangle, so I store data to its reg array. The reg array will contain 3 elements instead of 4.
Then make triangle skew to fill the triangle. The technique is similar to the movie "3d pyramid" that I describe in earlier sessions.