![]() ![]() Source files for the above example can be found here. (Then, add that to slower machines, and your animation will slow down and become jerky). Quicker redrawing of highly complex objects. Higher frame rates mean quicker redrawing. Objects with these aspects require more from your processor because they are redrawn each frame. Overall, bitmaps can increase performance significantly, especially if you are using complex objects, lots of animation, and/or high frame rates. So you can see that when working with alpha and gradients, which are already heavy on your CPU, you want to render them as bitmaps. When using bitmaps, you are only rendering what is visible on the stage. So, if you have a movieclip with 10,000 vector objects stacked on top of each other, it will render each of those 10,000 objects even if objects are hidden behind other objects. When vector is rendered on the stage, the Flash player will render everything. Using bitmaps is much more efficient than using vector. When you set the "cacheAsBitap" property on a display object to "true," what you are doing is telling the Flash player to cache an internal representation of the vector object as a bitmap. ![]() Why do we need to bother with the "cacheAsBitmap" property anyway? If you just want to use only ActionScript (this way is easier if you are dynamically placing objects onto the stage), you need to set both the alpha gradient mask and the mc being masked cacheAsBitmap property to "true." Using ActionScipt to set the caching is the same as checking "use runtime bitmap caching." mask_mc.cacheAsBitmap = true Īnd, just like above, apply your mask to your object. That's it! Publish your movie and you will see your alpha gradient movieclip masked. Now, click the "use runtime bitmap caching" box for both your mask and the item being masked. If you need to, open up your properties panel by clicking Windows => Properties => Properties. Youll see handles allowing you to edit the gradient in terms of scale and rotation. Now, set both the mask and the object to be cached as a bitmap at runtime. Select this tool and click on the gradient in your shape. On the timeline, enter the following code: object.mask = mask_mc Choose your gradient type, either Solid or Noise, from the pop-up menu. Pick an existing preset to use as the basis for your new gradient. Click the Edit button (which looks like a gradient swatch) on the Options bar. A masked layer does not allow for bitmap caching, so we're going to have to do that using ActionScript. Follow these steps to create a custom gradient: Select the Gradient tool from the Tools panel. Something we are not doing is creating a mask layer and a layer to be masked. It is necessary to convert both the mask and object being masked to movieclips so you can apply caching properties to them. Start by placing two objects on the stage, one an alpha gradient you want to use as a mask and the object you want to be masked.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |