The CPU speed in mobile phones varies among models and is typically much slower than the CPU speed in current desktop computers. Therefore, it is important to consider application performance and optimization from the beginning of each project for creating Flash Lite content for mobile phones.

Bitmap versus vector graphics

Flash Lite can render both vector and bitmap graphics, and each type of graphic has its advantages and disadvantages. Whether to use vector or bitmap graphics is not always a clear decision, and often depends on several factors. This section discusses some of the differences between vector and bitmap graphics to consider when deciding what type of graphic to use.
Vector graphics are compactly described in SWF files as mathematical equations, and then rendered at runtime by the Flash Lite player. In contrast, bitmap graphics are represented as arrays of picture elements (pixels), which require more bytes of data to describe. Therefore, using vector graphics in your application can help keep file size and application memory usage down.
Vector graphics also maintain their smooth shapes when scaled in size, unlike bitmaps images that can appear boxy, or pixelated, when scaled.
Compared to bitmaps, however, vector graphics require more processing power to render, especially vector graphics that consist of many complex shapes and fills. Consequently, heavy use of vector shapes can sometimes reduce overall application performance. Because bitmap graphics don’t require as much processing time to render as vectors, they can be a better choice for some applications. For example, a road map of a large city would have too many complex shapes to scroll and animate well on a mobile phone if it were created as a vector graphic; a bitmap would animate better.
Following is a list of additional considerations for using bitmap and vector graphics in your Flash Lite application:

  • Whenever possible, do not use strokes on your vector shapes, because doing so increases the number of rendered lines.
  • 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 size that they will be used in the application; don’t import large graphics and scale them down in Flash, as this wastes file size and runtime memory.

Animation guidelines

When creating animated content for a mobile phone, it is important to consider the phone’s CPU limitations. The following guidelines can help prevent your Flash Lite content from running slowly:

  • Flash Lite can render vector graphics in your application at three different quality levels: low, medium, and high. The higher the rendering quality, the more smoothly and accurately Flash Lite renders vector graphics and the more processing it requires of the device’s CPU. If you need to provide complex animation, experiment with changing the player’s quality setting of the content. Because changing the quality setting can noticeably affect the visual quality of the Flash Lite content, thoroughly test the SWF file.To control the rendering quality of a SWF file, you can use the _quality property or the SetQuality command.For the _quality property, valid values are LOW, MEDIUM, and HIGH. The following code sets the rendering quality to LOW:
    _quality = "LOW";
  • Limit the number of simultaneous tweens. Reduce the number of tweens, or sequence the animation so that one begins when another ends.
  • Use transparency (alpha) effects on symbols sparingly because they are CPU intensive. In particular, it is better to avoid tweening symbols with alpha levels that are not fully opaque (less than 100%).
  • Avoid CPU-intensive visual effects, such as large masks, extensive motion, alpha blending, extensive gradients, and complex vectors.
  • Experiment with combinations of tweens, keyframe animations, and ActionScript-driven movement to produce the most efficient results.
  • Rendering vector ovals and circles is much more memory intensive than rendering quadrangles. Using round and oval strokes also greatly increases CPU use.
  • Test animations frequently on your target devices.