MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 316

Actionscript 2.0 language reference
Table of Contents

Advertisement

If an image is an opaque image, it is considered a fully opaque rectangle for this method. Both
images must be transparent images to perform pixel-level hit testing that considers
transparency. When you are testing two transparent images, the alpha threshold parameters
control what alpha channel values, from 0 to 255, are considered opaque.
Availability: ActionScript 1.0; Flash Player 8
Parameters
firstPoint:flash.geom.Point
BitmapData instance.
firstAlphaThreshold:Number
for this hit test.
secondObject:Object
secondBitmapPoint:flash.geom.Point
the second BitmapData object. Use this parameter only when the value of
BitmapData object.
secondAlphaThreshold:Number
considered opaque in the second BitmapData object. Use this parameter only when the value
of
is a BitmapData object and both BitmapData objects are transparent.
secondObject
Returns
- A Boolean value. If there is a hit, returns a value of
Boolean
Example
The following example shows how to determine if a BitmapData object is colliding with a
.
MovieClip
import flash.display.BitmapData;
import flash.geom.Point;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var mc_1:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc_1.attachBitmap(myBitmapData, this.getNextHighestDepth());
var mc_2:MovieClip = createRectangle(20, 20, 0xFF0000);
var destPoint:Point = new Point(myBitmapData.rectangle.x,
myBitmapData.rectangle.y);
var currPoint:Point = new Point();
mc_1.onEnterFrame = function() {
316
ActionScript classes
- A point that defines a pixel location in the current
- The highest alpha channel value that is considered opaque
- A Rectangle, Point, or BitmapData object.
[optional] - A point that defines a pixel location in
[optional] - The highest alpha channel value that is
secondObject
; otherwise,
true
false
is a
.

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF