03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

The following example shows how to apply pixel noise to a BitmapData object for both a<br />

color <strong>and</strong> black-<strong>and</strong>-white bitmap.<br />

import flash.display.BitmapData;<br />

import flash.geom.Rectangle;<br />

import flash.geom.Point;<br />

var bitmapData_1:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);<br />

var bitmapData_2:BitmapData = new BitmapData(100, 80, false, 0x00FF0000);<br />

var mc_1:MovieClip = this.createEmptyMovieClip("mc",<br />

this.getNextHighestDepth());<br />

mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth());<br />

var mc_2:MovieClip = this.createEmptyMovieClip("mc",<br />

this.getNextHighestDepth());<br />

mc_2.attachBitmap(bitmapData_2, this.getNextHighestDepth());<br />

mc_2._x = 101;<br />

mc_1.onPress = function() {<br />

bitmapData_1.merge(bitmapData_2, new Rectangle(0, 0, 50, 40), new<br />

Point(25, 20), 128, 0, 0, 0);<br />

}<br />

mc_1.onPress = function() {<br />

bitmapData_1.noise(128, 0, 255, 1, true);<br />

}<br />

mc_2.onPress = function() {<br />

bitmapData_2.noise(128);<br />

}<br />

paletteMap (BitmapData.paletteMap method)<br />

public paletteMap(sourceBitmap:BitmapData, sourceRect:Rectangle,<br />

destPoint:Point, [redArray:Array], [greenArray:Array], [blueArray:Array],<br />

[alphaArray:Array]) : Void<br />

Remaps the color channel values in an image that has up to four arrays of color palette data,<br />

one for each channel.<br />

Flash Player uses the following steps to generate the resulting image:<br />

328 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!