Bitmap caching features in Flash 8

Source: Internet
Author: User
Tags numeric value
Cache

In the previous version of Flash if there is a large area, many, complex graphics in the film moving, often the phenomenon of movement is not smooth, now in Flash 8 added bitmap caching function to solve this problem!

When the MovieClip.cacheAsBitmap or Button.cacheAsBitmap property is set to true , Flash Player caches the internal bitmap representation of the movie clip or button instance. This can improve the performance of movie clips that contain complex vector content. All the vector data for a movie clip with a cached bitmap is plotted in place instead of on the main stage.

Using ActionScript to implement bitmap caching has the following three properties:

cacheasbitmap: Makes the movie clip instance cache its own bitmap representation. Flash creates a surface object for this instance, which is a cached bitmap, not a vector data. If you want to change the range of a movie clip, the surface is rebuilt instead of readjusted.

opaquebackground: Enables you to specify the background color of an opaque movie clip instance. If you set this property to a numeric value, the movie clip instance will have an opaque (non-transparent) surface. Opaque bitmaps do not have Alpha channels (transparency) and can be rendered more quickly.

scrollrect: Enables you to quickly scroll through the contents of a movie clip and view larger content in one window. Cuts the contents of the movie clip, and the instance scrolls by the specified width, height, and scroll offset. This allows users to quickly scroll through the contents of the movie clip and use a window to display larger content than the "stage" area. Text fields and complex content that are displayed in an instance can scroll faster, because Flash does not need to regenerate the entire movie clip vector data.

Attention:

1. Opaquebackground and Scrollrect Two properties only have the best effect if the Cacheasbitmap property is set to true.

2. You cannot apply a cache directly to a text field using the Scrollrect property. You need to place text in a movie clip to take advantage of this feature.

3. It is a good idea to cacheAsBitmap use a property with a movie clip that contains static content and is not frequently scaled and rotated.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.