Apr 26, 2007

flash: smooth scaling and rotating a dynamic bitmap

In duplicating the movie clip with bitmap data I think you can set a smoothing tag on the bitmap itself:

some_mc.attachBitmap(bmp, 1, "auto", true);

the true flag sets smoothing where its default is false.

This sort of workaround it necessary also for setting a loaded clips properties before its displayed on stage or has time to influence the properties of its parents. By loading it off stage some place, settings its properties and then duplicating it with bitmap data into the desired location.

Another:

do everything normally, except in your onLoadInit() function, do the following: (clip_a is my container for dynamic JPG)

On top of movie:

import flash.display.*;

then:
-myBitmap = new BitmapData(clip_a._width, clip_a._height, true, 0x00FFFFFF);
-myBitmap.draw(clip_a);
-removeMovieClip(clip_a);
-createEmptyMovieClip("clip_a", getNextHighestDepth());
-clip_a.attachBitmap(myBitmap, 1, "auto", true);

No comments: