By Jens C. Brynildsen from flashmagazine.com
“El 2006 será un buen año para la creatividad”

Flash programmers will jump of joy when they dig trough the new bitmap and filter classes. So much to learn, so little time… This article gives you a short overview of the new features as well as links to existing samples, using the function mentioned. The new video features as well as the Flash 8 IDE itself are covered in the main review.
CacheAsBitmap
The command will cache any vector object as a bitmap for increased speed, but any interactive bits of the object will still work. If you have an application that switches between screens, animated transitions will be much faster if the screen is cached as a bitmap before transitioning. Almost any vector object can benefit from bitmap caching, but once you cache an object, it is a bitmap and should not be rotated or scaled. If you do, Flash will have to re-cache the bitmap, resulting in a speed loss rather than speed increase.
Bitmap API
The Bitmap API… Where to start? I’ve wanted this feature in Flash for ages and now it’s here. You have total freedom using this toolset. Make yourself a canvas by creating a new instance of the bitmapData class. Then start drawing using commands such as setPixel(), make a color picker using getPixel(), make a brush class to implement fancy brushes like in PhotoShop, use the applyFilter() method to add blur and other cool effects… My imagination run wild once I start to ponder about the possibilities this API gives. Not only could you set out to make a Mini-Photoshop, but you could combine the bitmap API with the filters AND the blend-modes to make crazy looking art installations AND combine this with the new upload capabilities in Flash 8 and you can create creative online applications never seen before. Using the Bitmap API, you can create professional drawing applications that formerly only could be done online using Java.
How fast is the bitmap drawing then? How much screen estate can you expect to redraw at what framerate? Click here to open a new browser window with the test file (make sure you have the Flash 8 Player installed). The SWF file in this sample will create a canvas and fill it with random noise as often as it can (120 fps is max speed). This way, all pixels are changed from frame to frame. In the upper left corner, you can see the pixel dimensions and frames per second change as you scale the browser window up and down. This is no scientifical test, but it should give you an idea as to how large areas of the screen can be updated at what intervals. Keep in mind that this will vary strongly from machine to machine.
Filter API
Flash comes with a set of filters (Drop shadow, blur, glow, bevel, gradient bevel, and color adjust ), but from what we understand, you will be able to make your own by extending the new base classes for both filters and bitmaps. Filters are applied on a per object basis and after being applied, it’s treated as a bitmap.
Blend modes
Both buttons and MovieClips support Blend modes such as Normal, Layer, Darken, Multiply, Lighten, Screen, Overlay, Hard Light, Add, Subtract, Difference, Invert, Alpha and Erase. These are applied as properties of each object, so only one mode can be active at a time (as opposed to filters where you may have many filters per object).
Text rendering
You have probably seen some demo’s of this already. Not only do fonts look much better in Flash 8, but you also have means to adjust their display in several ways. The new method “fontRenderingMode” for the text object allows for five different settings: device, bitmap, standard, advanced and customThicknessSharpness. The last two of these are new. Advanced will use the new FlashType (formerly called Saffron) engine available in Flash 8 at standard settings. The last, customThicknessSharpness, allows as the name implies for custom thickness and sharpness settings per text field.
The TextField Class also has a new method called gridFitType. This method can force the Horizontal and vertical lines in the glyphs to either a pixel or subpixel grid. This can improve the readability and sharpness of the font.
SWF Metadata
Flash 8 defines two fields with metadata for all Flash files. These are Title and Description and you access them under Document Properties. Just fill in the text fields and the search engines will (eventually) know what info to display about your Flash site/file.
Post-processing
Flash 8 also contains a couple new features that can extend Flash in new ways. At the bottom of the Flash Publish window, you can find a dropdown allowing you to select “Post-processors”. A quick look in the documentation reveals “Post-processors are Window?s dlls or Macintosh bundles that perform a specific operation on a SWF file at the time it is created. For example, a post-processor could be used to replace certain words, or create an extra copy of the SWF file you are publishing. Macromedia mainly foresees using this functionality as a way to fix SWF files for use on mobile devices as new versions of devices are introduced to the market.”. Maybe this also could be used by the third-party Projector Tool Vendors? Could be used to skip some application switching?
External API
The ExternalInterface class is a brand new class intended to simplify communication between Flash and its Container (HTML page or Projector). This will replace the dreaded FSCommands and will probably be the way future Projector Tools does their magic. Using FSCommands with JavaScript has always been kind of Voodoo. Now we’ll have a standard interface that allows ping-pong communications between the container and the content.






0 Respuestas a “Flash 8 - New for Coders”
Añade un Comentario