all groups > flash actionscript > may 2006 >
You're in the

flash actionscript

group:

BitmapData



BitmapData the fleece
5/28/2006 9:58:19 PM
flash actionscript:
Re: BitmapData the fleece
6/4/2006 10:34:35 PM
fo thoughs who would know.... I did a search of this forum

//import BitmapData
import flash.display.BitmapData;
//stop movie so it doesn't repeat over and over
stop();
//load a pic into an mc on the stage
content_mc.loadMovie("flash.jpg", 1);
//create a function that runs every frame (only for this example, it keeps
running and you won't want that
_root.onEnterFrame = function() {
//this is the interesting bit, basically the next line is your preloader 100%
action, the pic has to actually have been fully loaded before we can do this
if (_root.content_mc.getBytesLoaded() == _root.content_mc.getBytesTotal()) {
//create a variable to hold the bitmapdata info
myBitmapData = new flash.display.BitmapData(content_mc._width,
content_mc._height, true, 0x00FFFFFF);
//copy the bitmap into the bitmapdata variable we just created
myBitmapData.draw(_root.content_mc);
//now attach it to a different mc for the sake of example
_root.content_mc2.attachBitmap(myBitmapData, 1, "auto", true);
//rotate both movieclips so you can see the difference
_root.content_mc._rotation = 30;
_root.content_mc2._rotation = 30;
}
};

thanks to myFlash83
AddThis Social Bookmark Button