Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > BitmapData (flash.display.BitmapData) > 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
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);
}
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00001966.html