Join Lee Brimelow for an in-depth discussion in this video Overview of Flash Player 10, part of Flash Player 10 New Features.
- View Offline
So before we actually get started looking at the new features of Flash Player 10 in detail, it's helpful just to have an overview of what is actually changed in this version of the Flash Player. Let's start with the new native 3D support. So this native 3D is meant for simple 3D effects and transitions. This isn't a full-blown 3D engine with lights, cameras and shaders. If you need to do simple 3D effects, this Native 3D Support is extremely easy to use. What this is, is essentially a set of new 3D properties on display objects and display objects are again things like sprites and movie clips.
So now you just have some additional properties like the Z property to actually manipulate and position display objects in 3D space. This 3D is actually fully interactive, so let's say I have a movie clip with a button inside of it. If I put that movie clip in 3D space I can still click on that button inside of it, so the 3D remains fully interactive. Any 3D objects you create are also automatically anti-aliased, so there aren't jagged edges. Everything looks smooth and nice when you put it into 3D.
And again, the important thing is this is not meant to replace 3D engines like Papervision3D, which are full-blown 3D environments. If you want to create these kind of immersive 3D worlds, you are still going to want to use open source engines like Papervision3D. Flash Player 10 also has a brand new text engine inside of it. This text engine has been completely rewritten, and it allows you to do some really advanced typography and text layouts inside of the Flash Player.
So this text engine was used to create a set of advanced text components called the Text Layout Framework that we're actually going to look at that allows you to do some really advanced things with text. Now these components were actually worked on by the Adobe InDesign team, and it's basically their whole world is text. So if you want any team in the world to be working on these components, it would be the InDesign team. So the text engine is actually a really low level ActionScript 3 API.
Now you have access to that API so if you are really knowledgeable about text, you can use that API. But most people are just going to use these new advanced text components that basically allows you to just right out of the box, do some advanced things with text. So with this text engine you can easily create right to left and vertical text, which is really important when you are internationalizing your Flash content, so languages like Japanese that actually is right to left and vertical, doing that in previous versions of the Flash Player was extremely difficult.
Device fonts are now equal to embedded fonts, so every Flash developer has had that situation where you use a device font but then you try to animate it or fade it and you can't do it. Well in Flash Player 10, device fonts can now be animated. You can change the transparency of them. So Pixel Bender is a brand new technology that allows you to create your own filters and effects for Flash. So in Flash 8 we actually released some basic filters like Drop Shadows, Bevels, and Blurs.
Well, this new language, a tool, allows you to create your own. Now these filters that you create in Pixel Bender can be used inside of Flash but also inside of Photoshop and After Effects. So we've unified the actual language that you use to write filters and effects for all three tools. And the place where you are going to actually write your Pixel Bender filters is called the Pixel Bender Toolkit, and we're going to look at how to create some simple Pixel Bender filters later on in the title.
So sound has had a major overhaul in Flash Player 10. You now have the ability to actually create sound from scratch inside of the Flash Player. And the way you do this is to respond to an event and Flash is actually going to ask you for raw sound data. So if you know a lot about audio or sound, you can actually provide just raw binary data and have it be played back by Flash. You also have now the ability to extract the bytes of an external sound, let's say an external MP3 file that you're playing.
You can extract the bytes of that file as it's coming into the Flash Player, manipulate those bytes before they actually get sent to the sound card. So this allows you to create real- time effects and processing for sound. There have also been several bug fixes to the existing sound API, especially surrounding the soundComplete event, so your general sound APIs have been improved in addition to having all of these new capabilities. Local file access is another really big feature in Flash Player 10, and this allows you to directly read local files from the user's machine and it also allows you to save files directly to the user's machine directly from the Flash Player.
Now this saving and reading of local files actually requires user interaction. So you can't do it programmatically, so the user has to actually initiate this either through a key press or a mouse-click. So there are no more round trips to your server required. So let's take an instance of you wanted the user to be able to load in an image from their hard drive into your Flash movie. In previous versions of Flash you would actually have to have them uploaded to your web server and then you would download it from your web server into your Flash movie.
Well, now we can do this directly without that round-trip. Now these new features are also part of some new security changes to the file reference class that we're going to look at as well. So there's been some major enhancements to the drawing API in Flash Player 10. So we now have an API for drawing triangles. Now if you've done 3D development before, you know that in 3D everything is made up of triangles. So we now have this low-level API to be able to draw triangles in 3D space. Now these triangles also support UV texture mapping and this is essentially how you would create say a 3D engine inside of Flash.
You would be drawing triangles and you'd be mapping textures onto those triangles. We now have the ability to do gradient and bitmap strokes. There is a new object-based drawing model. So in previous versions of Flash you would have to say line to, line to, move to, all these commands. Now we can actually save those commands inside of an object, so we can easily either change them or update them. And the performance of the drawing API has been greatly increased also. And we're going to look at certain methods that you can use that greatly enhance the performance when you want to draw graphics at runtime.
So there is also a whole host of smaller features. We have a new vector data type. Vectors are essentially mono-typed arrays. So in the regular array class you can store all different types of information. You could store a string, a movie clip. A vector is essentially an array that can only hold a single type of data and the benefits are greatly increased performance when you use vector over array. We now have partial fullscreen keyboard support in Flash Player 10. In previous versions of Flash if you went fullscreen with your application in the browser, you couldn't accept any keyboard input and this was for security reasons.
So this made it pretty hard to actually create a fullscreen game in Flash. In Flash Player we've loosened the security restriction to allow you to accept any non-printing keys like the Spacebar or the Arrow keys. So it's now a lot more likely that you would be able to create fullscreen games in Flash. There have been some enhancements to the garbage collection features, especially when it relates to cleaning up external SWF files and content. You can now do multi-bit rate video streaming inside of the Flash Player and this is in conjunction with Flash Media Server 3.5 and this basically allows you to on-the-fly change the bit rate of the video that the user is seeing and the user won't have any idea that it's actually happened.
So it's completely sceneless, so you are not asking them to switch to a lower bit rate stream. We have a microphone codec called Speaks, which is a high-quality codec specifically for voice. We've also added some new hardware acceleration features. The goal of Flash is to try to offload as much as we can to the user's GPU and Flash Player 10 has increased the amount that we're doing that, but definitely moving forward, that's a goal to continue to do that. So those are the major features in Flash Player 10 and now we can actually get started and learning how to use these features to create some cool content.
- 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