
447
USING FLASH CS4 PROFESSIONAL
Best practices
Vector graphics also maintain their smooth shapes when scaled in size. Bitmap images can appear boxy, or pixelated,
when scaled.
Compared to bitmaps, vector graphics require more processing power to render, especially vector graphics that have
many complex shapes and fills. Consequently, heavy use of vector shapes can sometimes reduce overall file
performance. Because bitmap graphics do not require as much processing time to render as vector graphics, they are
better choice for some files, for example, a complex road map meant to be animated and scrolled on a mobile phone.
Keep these considerations in mind:
•
Avoid using outlines on vector shapes. Outlines have an inner and outer edge (fills have only one) and are twice the
work to render.
•
Corners are simpler to render than curves. When possible, use flat edges, especially with very small vector shapes.
•
Optimization is especially helpful with small vector shapes such as icons. Complex icons may lose their details upon
rendering, and the work of rendering the details is wasted.
•
As a general rule, use bitmaps for small, complex images (such as icons) and vector graphics for larger and simpler ones.
•
Import bitmap graphics at the correct size; don’t import large graphics and scale them down in Flash, because this
wastes file size and run-time memory.
•
The Flash Lite player does not support bitmap smoothing. If a bitmap is scaled or rotated, it will have a chunky
appearance. If it is necessary to scale or rotate a graphic, consider using a vector graphic instead.
•
Text is essentially just a very complex vector shape. Of course, text is often critical, so it can rarely be avoided
entirely. When text is needed, avoid animating it or placing it over an animation. Consider using text as a bitmap.
For multiline dynamic and input text, the line break of the text string is not cached. Flash breaks lines at run time
and recalculates the breaks every time the text field needs to be redrawn. Static text fields are not problematic,
because the line breaking is precalculated at compile time. For dynamic content, using dynamic text fields is
unavoidable, but when possible, consider using static text fields instead.
•
Minimize the use of transparency in PNG files; Flash must calculate redraws even for the transparent portions of
the bitmap. For example, with a transparent PNG file that represents a foreground element, don't export the
transparent PNG at the full size of the screen. Instead, export it at the actual size of the foreground element.
•
Try to group bitmap layers together and vector layers together. Flash needs to implement different renderers for
bitmap and vector content, and switching between renderers takes time.
For more tips and techniques for creating content for mobile phones and devices, see
www.adobe.com/go/learn_cs_mobilewiki_en
.
Set compression of Flash Lite bitmaps for mobile devices
When using bitmaps, you can set image-compression options (on a per-image basis or globally for all bitmap images)
that reduce SWF file size.
For more tips and tricks about using Adobe Device Central with other Adobe products, see
www.adobe.com/go/learn_cs_mobilewiki_en
.
Set compression options for an individual bitmap file
1
Start Flash and create a document.
2
Select a bitmap in the Library window.
3
Right-click (Windows) or Control-click (Macintosh) the bitmap icon in the Library window, and select Properties
from the context menu to open the Bitmap Properties dialog box.
Updated 5 March 2009