SWF Assets - MovieClips containing Bitmaps


Hi all.

Some of my SWF assets contain Bitmaps which are bundled inside
a MovieClip. Obviously those Bitmaps get converted to simple shapes with a bitmap
fill by the compiler. Am I right? Is there a way to get the underlying BitmapData (if there
happens to be one) so I could set it’s .smoothing property to true - or do I have to manually
draw the shape to a BitmapData?

I’m asking because the Bitmaps look a little fuzzy if I directly add such a SWF Assets based MovieClip
to the stage. If I take the same MovieClip and draw it to a BitmapData at runtime, it looks a
lot better but I don’t want to do the extra work (not to mention the extra memory consumption) with every MovieClip.
Here’s a direct comparison:


I don’t think so. It should stay a Bitmap.

Sounds crazy to me as well.

Do you scale the Bitmap or its container somewhere (in the FLA or in openfl)? I’ve noticed that when you scale too much your bitmap, even with smoothing and no compression, the image is blurry. But I think it’s the same in as3?


Hey loudo.

No, it’s definitely a Shape - although that’s just true for the HTML5
target. On flash it seems to be a MovieClip. (verified by trace(mc.getChildAt(0)))

I forgot to mention that I’m targeting HTML5 and yes the container MovieClip gets
scaled according to the viewport of the browser window.
The first word shown in the image in my first post is such a container
MovieClip scaled down to say 0.453566 and afterwards I round it’s height,width,x and
y properties to integers.
The second word is an unscaled BitmapData the same visual width & height as
the first word were the container MovieClip gets drawn onto using BitmapData.draw
and a proper transformation matrix.

Well I’ve overcome the problem by writing a function that takes the child of
such a container MovieClip, draws the child Shape onto a BitmapData, adds it to the
container and finally removes the ‘original’ Shape. It works fine and is just one
line of extra code though I was hoping there’s an easier solution.


I just dug in, and it appears that the SWF specification does specify whether the bitmap will be smoothing or not. I’m not necessarily sure if it is not smoothed only when “Allow Smoothing” is unchecked for the bitmap in the Library panel, or if it also has to do with whether the object is transformed/rotated/scaled within the editor or not.

To my knowledge, we are handling the smooth setting provided by the SWF properly, though


Hey singmajesty!

You’re handling the smooth setting inside the swf properly - true.
I’m not using the Adobe Flash IDE to make my assets though but I
just realized my authoring tool offers this property too. Saves me
some headaches because I’ve also used FFDEC decompiler to manually
change that property for every shape with a bitmap fill.


Awesome! Glad to hear there’s a way to do this. Good thing is that gives you complete control, so you can disable smoothing for an object that should not be smoothed.