Skip to main content
Known Participant
April 13, 2010
Question

Id of inline graphic elements

  • April 13, 2010
  • 1 reply
  • 808 views

Hello

I am inserting inline graphics using editManager.insertInlineGraphic( ) by providing source as returned by server and giving height,width and selection state.How can i get the id of the graphic inserted.I created an object of InlineGraphicElement and assign id to it but the XML generated has not the id attribute in the img tag.

I got id when I insert through paragraphElement.addChildAt( ) or paragraphElement.addChild( ) but the image insert at the end of the text and the requirement is to insert image in the text.

Thanks

This topic has been closed for replies.

1 reply

Adobe Employee
April 13, 2010

Can you create a buildable AS3 sample showing the problem?

Thanks,

Richard

Known Participant
April 14, 2010

Hello Richard

I am writting few lines through which I am inserting graphics:

private var image:InlineGraphicElement = new InlineGraphicElement();

image.id = "Identifier";

image.source = contentPath;                                                           //content path is the path return by server

editManager.insertInlineGraphic(image.source,50,50,new SelectionState(textFlow,editManager.activePosition,editManager.activePosition));

textFlow.flowComposer.updateAllControllers();

Adobe Employee
April 15, 2010

The InlineGraphicElement you created on the first line of the sample code is unused.

The operation creates one for you at position 50.  To find it use:

image = textFlow.findLeaf(50) as InlineGraphicElement;

Then set the id to that InlineGraphicElement.

Richard