Floodfill (Bitmapdata.floodfill Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

See also
Rectangle (flash.geom.Rectangle)

floodFill (BitmapData.floodFill method)

public floodFill(x:Number, y:Number, color:Number) : Void
Performs a flood fill operation on an image starting at an (x, y) coordinate and filling with a
certain color. The
floodFill()
programs. The color is an ARGB color that contains alpha information and color
information.
Availability: ActionScript 1.0; Flash Player 8
Parameters
- The x coordinate of the image.
x:Number
- The y coordinate of the image.
y:Number
- The ARGB color to use as a fill. ARGB colors are often specified in
color:Number
hexadecimal format, like 0xFF336699.
Example
The following example shows how to apply a flood fill a color into to an image starting at the
point where a user clicks the mouse within a BitmapData object.
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());
myBitmapData.fillRect(new Rectangle(0, 0, 50, 40), 0x00FF0000);
mc.onPress = function() {
myBitmapData.floodFill(_xmouse, _ymouse, 0x000000FF);
}
310
ActionScript classes
method is similar to the paint bucket tool in various painting

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF