ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > BitmapData (flash.display.BitmapData) > scroll (BitmapData.scroll method) | |||
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
x:Number - The amount by which to scroll horizontally.
y:Number - The amount by which to scroll vertically.
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);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
myBitmapData.fillRect(new Rectangle(0, 0, 25, 80), 0x00FF0000);
mc.onPress = function() {
myBitmapData.scroll(25, 0);
}
|
|
|
|