Join Lee Brimelow for an in-depth discussion in this video Understanding the new 3D capabilities, part of Flash Player 10 New Features.
- View Offline
So one of the biggest new features in Flash Player 10 is the introduction of native 3D support. This is something that the Flash community has been asking for for years, and Flash Player 10 represents our first attempt to add some native support in the Flash Player. So in this video, I'm just going to briefly describe the capabilities of this new 3D support. So you can open up 3-D_overview.fla file and let's just quickly look at the structure of this movie.
So I have a movie clip here and I have double-click inside of it. I just have a simple two-frame movie with some actions and all it does is it changes the current frame when you rollover or roll out of it. So if we go back to the main timeline, I'll just test this so you can see it just essentially has a rollover state here. So the easiest way to use the new 3D capabilities is here inside of Flash CS4, because there are some new 3D tools that allow you to do it on the timeline without actually having to know any ActionScript.
So if we come down here to the fourth tool group in the Tools panel, we can see we have a 3D Rotation tool. So if I select that and click on my movie clip, we can now see we have a little controller here that allows me to rotate this clip in 3D space. So I can move it on the Y-axis here. If I move to the blue circle, I can move it on the Z-axis and I can also move it on the Y-axis. So now this 3D is commonly known as postcards in space or 2.5D.
That's because when I rotate this around, we can see that this actually has no depth to it. So it's just like taking a postcard and rotating it. So when you get around to the side, you essentially see nothing, because it has no depth. Now, this is the same type of 3D that you find in tools like After Effects. So that's the 3D Rotation tool. The other tool that's buried in here is the 3D Translation tool. So translation is just a fancy word for moving something. So here I can move it on the X-axis, I can move it on the Y-axis, or I can move it on the Z-axis.
When I do that, we can see it's actually bringing it farther or closer away from the camera. Now, the 3D Engine in Flash Player 10, we don't have an actual camera, but you can just take your viewpoint as being the camera. So again, moving this is adjusting it on the Z-axis. So I can also do this inside of the Properties panel. So we have a new section in the Properties panel called 3D Position and View. So inside of here, I can now adjust it on the Z-axis.
Now, this is different than adjusting it on the regular X and Y-axis. So as soon as I start manipulating this with the 3D tools, I've essentially put this movie clip into 3D mode, and then to adjust the X and Y, I need to do it here in the 3D Position and View section. Okay. So let me just undo these. So we can also manipulate movie clips and display objects in 3D using ActionScript. So what I can do here is I can give this clip an instance name.
I'll give an instance name of Bea. That's the name of my cat, and I already have a locked actions layer down here that we can use for our ActionScript. I'll open up the Actions panel. So now you're probably familiar with manipulating a clip. Say, I want to move it on the X-axis to bea.x = 50. Now, if I test the movie, we can see it's moved over to an X position of 50. Well, it's just as easy now to manipulate this clip in 3D space.
So if I come down here and I say bea.z, if I set it to 500, we can see it's moved away from the camera by 500 pixels, making it smaller. So if I were to give a positive number for Z, it's going to push it away from us, so it's going to get smaller. If I want to bring it closer, I can actually just give a negative value. So I could say -100. Now, you can see it's gotten closer. So that's how you adjust the positioning of this object, but what about the rotation? So ordinarily, in previous versions of Flash, if you wanted to adjust rotation, you would just say Rotation = 20.
Now, you can see I've rotated that movie clip by 20 degrees. Well, in Flash Player 10, you can still use Rotation for the normal type of rotation that you're used to. But we also now have it broken out into the different axises. So I can say rotationY = 30. We can see it's actually rotated that clip in 3D space along the Y-axis. So again, I can also choose rotationX.
We can see it's actually rotated it along the X-axis, and rotationZ. Now it's rotated on the Z-axis. So those are the main high-level properties that you can adjust, the Z position, and using the new 3D Rotation properties to manipulate your clip in 3D space. So that's the basic overview of the new 3D capabilities. In the rest of this chapter, we're going to be going more in-depth about some of the cool new stuff that you can do.
- Creating 3D animations in Flash CS4
- Building an interactive 3D picture cube with correct mapping
- Working with vertical and right-to-left international text
- Generating dynamic sounds directly from Flash
- Using the Speex audio codec for vocal audio compression