currPoint.x = mc_2._x;
currPoint.y = mc_2._y;
if(myBitmapData.hitTest(destPoint, 255, currPoint)) {
trace(">> Collision at x:" + currPoint.x + " and y:" + currPoint.y);
}
}
mc_2.startDrag(true);
function createRectangle(width:Number, height:Number,
color:Number):MovieClip {
var depth:Number = this.getNextHighestDepth();
var mc:MovieClip = this.createEmptyMovieClip("mc_" + depth, depth);
mc.beginFill(color);
mc.lineTo(0, height);
mc.lineTo(width, height);
mc.lineTo(width, 0);
mc.lineTo(0, 0);
return mc;
}
loadBitmap (BitmapData.loadBitmap method)
public static loadBitmap(id:String) : BitmapData
Returns a new BitmapData object that contains a bitmap image representation of the symbol
that is identified by a specified linkage ID in the library.
Availability: ActionScript 1.0; Flash Player 8
Parameters
- A linkage ID of a symbol in the library.
id:String
Returns
flash.display.BitmapData
Example
The following example loads a bitmap with the linkageId
You must attach it to a
import flash.display.BitmapData;
var linkageId:String = "libraryBitmap";
var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);
trace(myBitmapData instanceof BitmapData); // true
- A bitmap image representation of the symbol.
object to give it a visual representation.
MovieClip
libraryBitmap
BitmapData (flash.display.BitmapData)
from your library.
317
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?