BitmapData (flash.display.BitmapData)
309
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 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);
}
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...