Showing 1 - 1 of 1 total. RSS Feed WordPress RSS Feed

Create a BitmapData from an asset embedded inside an SWF

The goal of this snippet is to create a BitmapData from an assets (for example a MovieClip) stored inside an SWF library created using Flash and loaded through CSS;
//CSS FILE
.myComponentStylName {

backgroundImage : Embed(source="library.swf", symbol="MyMovieClip");

}

//ActionScript Code

var BackgroundImage:Class = getStyle("backgroundImage");

var backgroundImageAsset:SpriteAsset = SpriteAsset(new BackgroundImage());

var bitmapData = new BitmapData(backgroundImageAsset.width, backgroundImageAsset.height);

var matrix:Matrix = new Matrix();

bitmapData.draw(ImageSnapshot.captureBitmapData(backgroundImageAsset),matrix);

Showing 1 - 1 of 1 total. RSS Feed WordPress RSS Feed