Friday, March 26, 2010

Insert GraphicElements into TextFlow...

I'm building a rich text editor with RichEditableText. I want to be able to insert image elements on click of a button. How do I insert images into the textflow at a certain position? I need it to function as if I inserted an img tag directly into the html, so it will load the image with the url I provide. How best can I go about this?

Insert GraphicElements into TextFlow...

Ok, I just discovered the flashx.textLayout.elements.InlineGraphicElement, but now how do I insert it into a certain position in the TextFlow? I'm working primarily with the spark.components.TextArea component, and I'm using SDK 4.0.0.10220. I need to insert it into the position where the caret is currently at (TextArea.selectionAnchorPosition). How do I discover at what index to insert the graphic element at?

Insert GraphicElements into TextFlow...

I think you want to use the insertInlineGraphicElement() method of EditManager.

Gordon Smith

Adobe Flex SDK Team

Thanks, Gordon, that helps a lot.

No comments:

Post a Comment