EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Mapbitmap (Displacementmapfilter.mapbitmap Property)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
520 ActionScript classes
function createTextBlock():MovieClip {
var txtBlock:MovieClip = this.createEmptyMovieClip("txtBlock",
this.getNextHighestDepth());
txtBlock.createTextField("txt", this.getNextHighestDepth(), 0, 0, 300,
80);
txtBlock.txt.text = "watch the text bend with the displacement map";
return txtBlock;
}
mapBitmap (DisplacementMapFilter.mapBitmap
property)
public mapBitmap : BitmapData
A BitmapData object containing the displacement map data.
The
mapBitmap property cannot be changed by directly modifying its value. Instead, you
must get a reference to
mapBitmap, make the change to the reference, and then set mapBitmap
to the reference.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example changes the
mapBitmap property on the existing MovieClip
filteredMc when a user clicks it.
import flash.filters.DisplacementMapFilter;
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Matrix;
import flash.geom.ColorTransform;
var filteredMc:MovieClip = createDisplacementMapRectangle();
var scope:Object = this;
filteredMc.onPress = function() {
var filter:DisplacementMapFilter = this.filters[0];
filter.mapBitmap = scope.createGradientBitmap(300, 80, 0xFF000000,
"linear");
this.filters = new Array(filter);
}
function createDisplacementMapRectangle():MovieClip {
var mapBitmap:BitmapData = createGradientBitmap(300, 80, 0xFF000000,
"radial");
var filter:DisplacementMapFilter = new DisplacementMapFilter(mapBitmap,
new Point(-30, -30), 1, 1, 10, 10, "wrap", 0x000000, 0x000000);
var txtBlock:MovieClip = createTextBlock();

Table of Contents

Related product manuals