326
ActionScript classes
rectangle (BitmapData.rectangle property)
public rectangle : Rectangle [read-only]
The rectangle that defines the size and location of the bitmap image. The top and left of the
rectangle are 0; the width and height are equal to the width and height in pixels of the
BitmapData object.
Availability:
ActionScript 1.0; Flash Player 8
Example
The following example shows that the
rectangle
property of the
Bitmap
instance is read-
only by trying to set it and failing:
import flash.display.BitmapData;
import flash.geom.Rectangle;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
var mc:MovieClip = this.createEmptyMovieClip("mc",
this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
trace(myBitmapData.rectangle); // (x=0, y=0, w=100, h=80)
myBitmapData.rectangle = new Rectangle(1, 2, 4, 8);
trace(myBitmapData.rectangle); // (x=0, y=0, w=100, h=80)
scroll (BitmapData.scroll method)
public scroll(x:Number, y:Number) : Void
Scrolls an image by a certain (
x
,
y
) pixel amount. Edge regions outside the scrolling area are
left unchanged.
Availability:
ActionScript 1.0; Flash Player 8
Parameters
x
:Number
- The amount by which to scroll horizontally.
y
:Number
- The amount by which to scroll vertically.
Example
The following example shows how to scroll a BitmapData object.
import flash.display.BitmapData;
import flash.geom.Rectangle;
var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC);
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...