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.

}<br />

return bmp;<br />

function createTextBlock():MovieClip {<br />

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

this.getNextHighestDepth());<br />

txtBlock.createTextField("txt", this.getNextHighestDepth(), 0, 0, 300,<br />

80);<br />

txtBlock.txt.text = "watch the text bend with the displacement map";<br />

return txtBlock;<br />

}<br />

See also<br />

BitmapData (flash.display.BitmapData)<br />

mapPoint (DisplacementMapFilter.mapPoint<br />

property)<br />

public mapPoint : Point<br />

A flash.geom.Point value that contains the offset of the upper-left corner of the target<br />

movie clip from the upper-left corner of the map image.<br />

The mapPoint property cannot be changed by directly modifying its value. Instead, you must<br />

get a reference to mapPoint, make the change to the reference, <strong>and</strong> then set mapPoint to the<br />

reference.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 8<br />

Example<br />

The following example changes the mapPoint property on the existing MovieClip<br />

filteredMc when a user clicks it.<br />

import flash.filters.DisplacementMapFilter;<br />

import flash.display.BitmapData;<br />

import flash.geom.Point;<br />

import flash.geom.Matrix;<br />

import flash.geom.ColorTransform;<br />

var filteredMc:MovieClip = createDisplacementMapRectangle();<br />

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

var filter:DisplacementMapFilter = this.filters[0];<br />

filter.mapPoint = new Point(-30, -40);<br />

this.filters = new Array(filter);<br />

this._x = 30;<br />

528 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!