fillRect (BitmapData.fillRect method)

public fillRect(rect:Rectangle, color:Number) : Void

Fills a rectangular area of pixels with a specified ARGB color.

Availability: ActionScript 1.0; Flash Player 8

Parameters

rect:flash.geom.Rectangle - The rectangular area to fill.

color:Number - The ARGB color value that fills the area. ARGB colors are often specified in hexadecimal format; for example, 0xFF336699.

Example

The following example shows how to fill an area that is defined by a Rectangle within a BitmapData with a color.

import flash.display.BitmapData;
import flash.geom.Rectangle;

var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);

var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());

mc.onPress = function() {
    myBitmapData.fillRect(new Rectangle(0, 0, 50, 40), 0x00FF0000);
}

See also

Rectangle (flash.geom.Rectangle)


Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00001951.html