EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Height (Bitmapdata.height Property); Hittest (Bitmapdata.hittest Method)

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...
BitmapData (flash.display.BitmapData) 315
var green:String = (myBitmapData.getPixel32(0, 0) >> 8 &
0xFF).toString(16);
trace(">> green: " + green); // cc
var blue:String = (myBitmapData.getPixel32(0, 0) & 0xFF).toString(16);
trace(">> blue: " + blue); // ee
trace("0x" + alpha + red + green + blue); // 0xffaaccee
See also
getPixel (BitmapData.getPixel method)
height (BitmapData.height property)
public height : Number [read-only]
The height of the bitmap image in pixels.
Availability: ActionScript 1.0; Flash Player 8
Example
The following example shows that the
height property of the BitmapData instance is read-
only by trying to set it and failing:
import flash.display.BitmapData;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
trace(myBitmapData.height); // 80
myBitmapData.height = 999;
trace(myBitmapData.height); // 80
hitTest (BitmapData.hitTest method)
public hitTest(firstPoint:Point, firstAlphaThreshold:Number,
secondObject:Object, [secondBitmapPoint:Point],
[secondAlphaThreshold:Number]) : Boolean
Performs pixel-level hit detection between one bitmap image and a point, rectangle or other
bitmap image. No stretching, rotation, or other transformation of either object is considered
when doing the hit test.

Table of Contents

Related product manuals