I've got a movie clip on the stage that's rotated 10°, with a dynamic text box inside. I'm loading some text, with an embedded image into it thus:
(Using 1st frame AS3 for now, eventually this will go in a class.)
var txt:String = '<img src="foo.gif" id="myImg1" /><p>Lorem ipsum</p>';
my_mc.txtBox.htmlText = txt;
Which works fine. The text gets placed, and even wraps around the image nicely. Problem is, the image looks horrible. I found the Bitmap.smoothing property, but can't seem to access the image to set the property. I'm trying this code:
var img:DisplayObject = my_mc.txtBox.getImageReference('myImg1');
if (typeof(img) != 'undefined') {
img.contentLoaderInfo.addEventListener(Event.COMPLETE, onHtmlImageLoaded);
}
function onHtmlImageLoaded(event:Event):void{
event.target.removeEventListener(Event.COMPLETE, onHtmlImageLoaded);
Bitmap(event.target.content).smoothing = true;
}
the 'img.contentLoaderInfo...' line throws this error, though:
1119: Access of possibly undefined property content through
a reference with static type flash.display:DisplayObject.