xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="initApp()">
import flashx.textLayout.events.StatusChangeEvent;
import flashx.textLayout.elements.*;
import flashx.textLayout.*;
[Bindable]
private var textFlow:TextFlow;
private var img:InlineGraphicElement;
private function initApp():void {
textFlow = new TextFlow();
textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,sizeGraphic);
var p:ParagraphElement = new ParagraphElement();
img = new InlineGraphicElement();
img.source = "a.gif";
p.addChild(img);
textFlow.addChild(p);
}
private function sizeGraphic(e:StatusChangeEvent):void {
if (e.status == "ready" || e.status == "sizePending") {
img.height = img.measuredHeight;
img.width = img.measuredWidth;
}
}
horizontalCenter="0" verticalCenter="0">
textFlow="{textFlow}" />