Fill
Techniques - Bitmap Fill
         by kirupa

In case you stumbled here without having first completed the first few pages, please click here. The earlier pages contain some useful information that may not be emphasized in great detail in these pages.

Method the Last: The Bitmap Fill
All of the previous fill methods you have encountered involved applying a color to your object. The Bitmap fill is different, because, instead of filling your object with a color, you will be filling your object with the contents of a bitmap image:

  1. First, in order to use a graphic, we must first find one. Copy the image from this link and paste it into your Flash document.
     
  2. Once the image has been copied into your Flash document, press Delete or something to get rid of it from the work area. Don't worry - the image should automatically be stored in your Flash Library.
     
  3. Select your rectangle, go to the Color Mixer, click the fill type drop-down menu, and select Bitmap. Select the picture of the peppers that is displayed:

[ select the peppers graphic that is displayed ]

  1. Your rectangle should now have the peppers image as its background. If not, click the Paint Bucket Tool and apply this Bitmap fill to your rectangle.
     
    Your rectangle may look similar to the following image:

[ how your rectangle looks now ]

  1. If you want, you can adjust the fill's properties using the Fill Transform Tool. Yes - the Transform tool works for images also! Click the Fill Transform tool and select your rectangle again.

    The following is how my image looks after I zoomed out and adjusted the orientation of the peppers a little bit:

[ The Free Transform Tool is Awesome ]
 

 Note
The above method I mentioned (paste and delete) for adding a bitmap fill is actually a roundabout method. The easiest method would be to simply select Bitmap from the drop-down menu in the Color Mixer Panel first, and then browsing for your image. Another way would be to simply import your image to your Library by going to File | Import. Either way, the image will be selectable via the Bitmap option in the Color Mixer Panel.

The reason I chose this method is, I was unable to get the images to display properly. When I applied the Bitmap fill using an image directly imported into the Library or browsed and imported via the Bitmap option, here is how the fill displayed:

Notice that the image is scaled down and tiled throughout the bitmap. This is, of course, illogical because the image is dimensionally larger than the actual rectangle.

You can use the Fill Transform tool to resize the images into its normal shape, but I feel that is not needed when the roundabout method I mentioned in the tutorial should help. I am not sure if this is an annoying bug, but if anybody could point out why it does that, I would be more than happy to hear about it.

 

With that said, you have learned almost everything about Fills in Flash MX 2004 - for now!

Just a final word before we wrap up. If you have a question and/or want to be part of a friendly, collaborative community of over 220k other developers like yourself, post on the forums for a quick response!

Kirupa's signature!

 

Previous Page

 

 

 




SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple.