Skip to main content
Known Participant
Apr 13, 2010 2:21 PM UTC
Question

Id of inline graphic elements

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 is closed to new replies. Start a new post to keep the conversation going.

4 replies

Inspiring
Apr 13, 2010 11:04 PM UTC

Can you create a buildable AS3 sample showing the problem?

Thanks,

Richard

Translate
Known Participant
Apr 14, 2010 5:04 AM UTC

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();

Translate
Inspiring
Apr 15, 2010 4:17 AM UTC

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

Translate