mc_1.onPress = function() {
myBitmapData.draw(mc_2, myMatrix, myColorTransform, blendMode,
myRectangle, smooth);
}
function createRectangle(width:Number, height:Number,
color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
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 ARGB color value that fills the area. ARGB colors are often specified in
color:Number
hexadecimal format; for example, 0xFF336699.
Example
The following example shows how to fill an area that is defined by a
with a color.
BitmapData
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);
}
- The rectangular area to fill.
BitmapData (flash.display.BitmapData)
within a
Rectangle
309
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?