BitmapData (flash.display.BitmapData)
319
var mc_2:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc_2.attachBitmap(bitmapData_2, this.getNextHighestDepth());
mc_2._x = 101;
mc_1.onPress = function() {
bitmapData_1.merge(bitmapData_2, new Rectangle(0, 0, 50, 40), new
Point(25, 20), 128, 0, 0, 0);
}
noise (BitmapData.noise method)
public noise(randomSeed:Number, [low:Number], [high:Number],
[channelOptions:Number], [grayScale:Boolean]) : Void
Fills an image with pixels representing random noise.
Availability:
ActionScript 1.0; Flash Player 8
Parameters
randomSeed
:Number
- The random seed to use.
low
:Number
[optional] - The lowest value to generate for each channel (0 to 255). The
default is 0.
high
:Number
[optional] - The highest value to generate for each channel (0 to 255). The
default is 255.
channelOptions
:Number
[optional] - A number that can be a combination of any of the four
color channel values:
1
(red),
2
(green),
4
(blue), and
8
(alpha). You can use the logical OR
operator
|
to combine channel values. The default value is
(1 | 2 | 4)
.
grayScale
:Boolean
[optional] - A Boolean value. If the value is
true
, a grayscale image is
created by setting all of the color channels to the same value. The alpha channel selection is
not affected by setting this parameter to
true
. The default value is
false
.
Example
The following example shows how to apply pixel noise to a BitmapData object for both a
color and black-and-white bitmap.
import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
var bitmapData_1:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var bitmapData_2:BitmapData = new BitmapData(100, 80, false, 0x00FF0000);
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...