randomSeed:Number
default value is 0.
numberOfPixels:Number
[optional] - An ARGB color value that you use to fill pixels whose source
fillColor:Number
value equals its destination value. The default value is 0.
Returns
- The new random seed value to use for subsequent calls.
Number
Example
The following example uses
one by dissolving 40 pixels at a time until all 8000 pixels have changed colors:
import flash.display.BitmapData;
import flash.geom.Point;
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() {
var randomNum:Number = Math.floor(Math.random() * 10);
dissolve(randomNum);
}
var intervalId:Number;
var totalDissolved:Number = 0;
var totalPixels:Number = 8000;
function dissolve(randomNum:Number) {
var newNum:Number = myBitmapData.pixelDissolve(myBitmapData,
myBitmapData.rectangle, new Point(0, 0), randomNum, 40, 0x00FF0000);
clearInterval(intervalId);
if(totalDissolved < totalPixels) {
intervalId = setInterval(dissolve, 10, newNum);
}
totalDissolved += 40;
}
[optional] - The random seed to use to start the pixel dissolve. The
[optional] - The default is 1/30 of the source area (width x height).
pixelDissolve()
to convert a grey
BitmapData
BitmapData (flash.display.BitmapData)
object to a red
325
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?