Please find the attached flex project. Its a basic editor. After i insert image to my editor it does not show this but a space is covered by image. after i edit by delete or update my text image shows up. Please help what is missing
/** Hell world text example with an inline graphic */ public class InlineGraphic extends Sprite { private var _textFlow:TextFlow;
public function InlineGraphic() { _textFlow = new TextFlow(); _textFlow.fontSize = 48; var p:ParagraphElement = new ParagraphElement(); _textFlow.addChild(p);
var span:SpanElement = new SpanElement(); span.text = "Hello "; p.addChild(span);
// InlineGraphicElement has "auto" width/height so the size can't be calculated till the graphic is loaded var inlineGraphic:InlineGraphicElement = new InlineGraphicElement(); inlineGraphic.source = "http://www.adobe.com/shockwave/download/images/flashplayer_100x100.jpg"; p.addChild(inlineGraphic);
var span2:SpanElement = new SpanElement(); span2.text = " World"; p.addChild(span2);
// event sent when graphic is done loading _textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,graphicStatusChangeEvent);
// this call compose but the graphic hasn't been loaded from the source URL yet. // The actualWidth and actualHeight are zero. _textFlow.flowComposer.updateAllControllers(); }
private function graphicStatusChangeEvent(e:StatusChangeEvent):void { // if the graphic has loaded update the display // actualWidth and actualHeight are computed from the graphic's height if (e.status == InlineGraphicElementStatus.READY || e.status == InlineGraphicElementStatus.SIZE_PENDING) { _textFlow.flowComposer.updateAllControllers(); } } } }