2 Replies Latest reply on Apr 13, 2011 7:26 AM by DilipShah

    TextArea - Insert an image at user selected position

    DilipShah Level 1
      I'm trying to develop a feature where I can insert an image at a specific position in TextArea with the help of Actionscript.
      I can get the character position using  selectionAnchorPosition property.
      I can create image using InlineGraphicElement that I can add to the TextArea's TextFlow's addChild method, but that adds the image at the end of the content.
      There is also addChildAt method that allows me to add paragraph with this image in TextFlow at a specific index. But for that, you need to know the index.
      How do I find the child index from the cursor location? Also, addChildAt allows adding a paragraph. How do I add this image within an existing paragraph?
      Please help... thanks!