User Guide
MovieClip 829
Pixel snapping forces the position of the bitmap to the nearest whole pixel value instead of
positioning to be on a partial pixel. There are three pixel snapping modes:
■ Auto mode does pixel snapping as long as the bitmap is not stretched or rotated.
■ Always mode always does pixel snapping, regardless of stretching and rotation.
■ Never mode turns off pixel snapping for the movie clip.
Smoothing mode affects the appearance of the image when it is scaled.
Availability: ActionScript 1.0; Flash Player 8
Parameters
bmp:flash.display.BitmapData - A transparent or opaque bitmap image.
depth:Number - An integer that specifies the depth level within the movie clip where the
bitmap image should be placed.
pixelSnapping:String [optional] - The pixel snapping modes are auto, always, and
never. The default mode is auto.
smoothing:Boolean [optional] - The smoothing mode is either true for enabled or false
for disabled. The default mode is disabled.
Example
The following attaches a very basic bitmap to a movie clip:
import flash.display.*;
this.createEmptyMovieClip("bmp1", this.getNextHighestDepth());
var bmpData1:BitmapData = new BitmapData(200, 200, false, 0xaa3344);
bmp1.attachBitmap(bmpData1, 2, "auto", true);
If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method, which is
used in this example.
attachMovie (MovieClip.attachMovie method)
public attachMovie(id:String, name:String, depth:Number,
[initObject:Object]) : MovieClip
Takes a symbol from the library and attaches it to the movie clip. Use
MovieClip.removeMovieClip() or MovieClip.unloadMovie() to remove a SWF file
attached with
attachMovie() method.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Player 5