Graphics Programs Reference
In-Depth Information
Tip: Verify that the expression
var numberOfObjects:Number = object_mc._totalframes-1;
will work as a general means to enable us to rotate any number of objects from within
the object_mc movie clip.
Exercise 6.6: Rotating Bitmap Objects
If we look at the size of the .swf file from the previous exercise, it weighs in at about
a reasonable 26 KB, with about half that size being taken up by the background image.
The objects that we used were all vector graphics. Suppose the objects to be rotated
are bitmaps instead. What does that do to the file size?
Let's look a simple example. Suppose we wanted to use eight bitmap graphics such as
those shown in Figure 6.17. Each object is about 130 pixels wide by 384 pixels high.
As transparent .png files, the size of the three are 76 KB, 84 KB, and 60 KB respective-
ly, for an average of about 73 KB each. Clearly, importing eight of these would produce
a file size that would be excessively large. The way around this problem is to load them
dynamically when we need them. Let's take a look at what's involved. We'll use the pre-
vious exercise as a jumping-off point.
Figure 6.17 Sample bitmap objects to be rotated
Search WWH ::




Custom Search